Re: referring to a temp table in a procedure?

From: Sridhar Subramaniam <avion_at_ozemail.com.au>
Date: 1996/11/13
Message-ID: <32899BF5.6323_at_ozemail.com.au>#1/1


L. Tseng wrote:
>
> I don't know if this is a trivial question but I am hitting
> the wall now. Any help will be very appreciated!!!
>
> What I want to do is
>
> In a strored procedure,
>
> create a temp table;
>
> insert some rows to the temp table;
>
> create a cursor on the temp table;
>
> Loop thru the temp table with the DBMS_OUTPUT;
>
> It seems to me DBMS_SQL is the only way to go but...
>
> Can what I want be achieved? how?
>
> Thank you very much.
>
> Leslie
Leslie,
The way you are going, dbms_sql seems to be the only way since ddls are not supported in pl/sql.

A better way is to create pl/sql table and loop thro' it. Depending on the version of oracle you use, pl/sql support for table-type variables differ. In ver 2.0 and 2.1 pl/sql supports one dimensional array-like tables. 2.3 supports table of records and table-type attributes.

Check your pl/sql manual for more details

-- 
Cheers

Sridhar Subramaniam
Avion Consulting Services
Sydney - Australia
Email : avion_at_ozemail.com.au

Disclaimer : All opinions are truly and just mine.
Received on Wed Nov 13 1996 - 00:00:00 CET

Original text of this message