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 -> PL/SQL Table as Result of stored Function

PL/SQL Table as Result of stored Function

From: jeremy twiggs <jeremy_at_hotelscene.co.uk>
Date: Mon, 13 Sep 1999 09:56:50 GMT
Message-ID: <01befdce$319521e0$0b0410ac@jeremy.hotelscene.co.uk>


Help, can anybody point me in the right direction?

Can I write a SQL statement that calls a stored PL/SQL function that uses a PL/SQL table for its return parameter?

i.e:

TYPE PRICE_RecType IS RECORD (

	price_type 	varchar2(10) := '',
	cost		number(5,5) := 0);

TYPE PRICE_TabTyp IS TABLE OF PRICE_RecType
	INDEX BY BINARY_INTEGER;

CREATE or REPLACE function GetPriceInfo(code in number(6)) RETURN PRICE_TabType IS
  PRICE_tab PRICE_TabTyp;
BEGIN    blah, blah, blah...

  RETURN PRICE_tab;

END; then use it like

SELECT
  a.code,
  GetPriceInfo (a.code)
FROM
  a_table a

such that it will return the columns
code, price_type and cost. Received on Mon Sep 13 1999 - 04:56:50 CDT

Original text of this message

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