Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> PLSQL: Function Returning a table

PLSQL: Function Returning a table

From: Mark Aurit <mark_aurit_at_mail.northgrum.com>
Date: Mon, 14 Sep 1998 18:29:14 GMT
Message-ID: <35fd5e89.4429218@news.northgrum.com>


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;

END; Any help is greatly appreciated.
Mark
mark_aurit AT-SIGN mail.northgrum.com Received on Mon Sep 14 1998 - 13:29:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US