Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PLSQL: Function Returning a table
I need to return a PL/SQL Table from a Function, and have had no luck
(Im using a publicly defined table and accessing it through a
Procedure in the mean time. Works, but its ugly) I get various
type-related errors when trying something like this:
CREATE OR REPLACE PACKAGE mine IS
TYPE tblfoo1 TABLE OF VARCHAR2(4) INDEX BY BINARY_INTEGER; itblfoo1 tblfoo1; FUNCTION myfunc (id IN VARCHAR2) RETURN itblfoo1;END; CREATE OR REPLACE PACKAGE BODY mine IS
FUNCTION myfunc (id IN VARCHAR2) RETURN itblfoo1 IS BEGIN itblfoo1(1) := 'TOAD'; RETURN itblfoo1; END;