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 -> Re: PL/SQL Table question

Re: PL/SQL Table question

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 20 Nov 2001 09:58:47 -0800
Message-ID: <9te5kn02792@drn.newsguy.com>


In article <1006270399.648665_at_halvan.trd.sintef.no>, "Olaf says...
>
>Hello!
>
>I need to return data stored in a PL/SQL table (from a stored procedure)
>as it was a ordinary database table. I was thinking of using a method like:
>

see
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1950575417033

for howto

>But it doesn't seem to work:
>DECLARE
>
>TYPE type_sum_rec IS RECORD (v_prosjekt_id number(10), v_navn
>prosjekt.navnTYPE);
>
>TYPE type_sum_tab IS TABLE OF type_sum_rec INDEX BY BINARY_INTEGER;
>
>
>sum_tab type_sum_tab;
>
>BEGIN
>
>sum_tab(1).v_prosjekt_id := 1;
>
>sum_tab(1).v_navn := 'test';
>
>sum_tab(2).v_prosjekt_id := 2;
>
>sum_tab(2).v_navn := 'olaf';
>
>
>select sum_tab FROM Dual;
>
>
>END;
>
>
>
>Olaf
>
>
>

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Tue Nov 20 2001 - 11:58:47 CST

Original text of this message

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