Oracle extract records from temporary table

Assume that I am using a temporary table in a procedure and I am inserting records and updating another set of records through Merge statement. If I use cursor in that temporary table, How can I extract all of the records from temporary table at the end of the stored procedure. Can you please give coding for this.

Showing Answers 1 - 6 of 6 Answers

priyanka jolly

  • Nov 24th, 2007
 

Create Global temporary tables and say on commit preserve rows. The global temporary tables have data available till the session is active. So you if you insert it at one procedure and want to access it somewhere else you can do that very easily till the session is active

Thanks
Priyanka

  Was this answer useful?  Yes

johnjerry

  • Oct 7th, 2009
 

Make sure you do not COMMIT* in the middle of the procedure. You can do any number of insertion into and deletion from temporary table and use "Select * from temp_table" to fetch available data.
Do not preserve rows unless it is required once session is expired.

* DO NOT use commit very frequently inside procedure as it downsizes overall system performance. 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions