Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Server temporary tables equivalent in PL/SQL ?

341823Sep 19 2002
Hi,

old story. Migrating SQL Server to Oracle. Now, we have about 400sps to convert and half of them are using temporary tables for some complex calculations.

My question is:

Select 3-4 different recordsets within one stored procedure, store them in temp tables (in SQL Server), join this recordsets with few other tables and return one recordset as a result. In TSQL you declare temp table, do some processing ( you cen join temp tavles with permanent tables) and when you finish drop the tables. Couldn't find equivalent in PL/SQL. Using global temporary tables does not sound very good (I would need 50+ temporary tables..). Using PL/SQL tables is not quite clearly explained in documentation...

Now I could use ordinary SQL like:

select T1.field1, T1.field2
from Table1 T1, (select filed1, field2 from Table2) T2, (select field1, field2 from Table3) T3
where T1.field1 = T2.field1
and T1.field1 = T3.field1.....

but sometimes I need to update second or third recordset. Dead end.

Please help,


SasaN
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2002
Added on Sep 19 2002
4 comments
434 views