Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

procedure array output

Status
Not open for further replies.

zapster

Programmer
Jun 8, 2001
36
GB
Hi All

Ok is it possible to return an array of records from a procedure in Oracle 7.

if so can someone give me the basic working example, as I can't seem to get is to work, and I don't know if this is possible

Thanks

 
create package emp_test is
type t_emp is table of emp%rowtype index by binary_integer;
procedure get_emps(pemp out t_emp);
end;

create package body emp_test is
procedure get_emps(pemp out t_emp)
is
i integer :=0;
begin
for f in (select * from emp) loop
i := i+1;
pemp(i) := f;
end loop;
end;
end;

The above will probably work on 7.3+
For earlier 7 versions you may return a set of simple (one column) tables. Of course you should make a number of asignments.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top