Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
DB2 Temporary Tables

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message

New User

Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Thu Jul 14, 2005 5:33 pm    Post subject: DB2 Temporary Tables
Reply with quote


I need to know

1. what is the purpose of using temp. tables inside stored procs?
2. When the temp. table will get destroyed if it is not dropped in a stored pro?

Also tell me whether (a) or (b) is more efficient.
(a) I have a single query with two Full outer joins declared in a cursor. I'll open it at the end of the proc for the fron end to retrieve data.

(b) I have three cursors... I'll declare a temp table and populate each row with the value fetched from the three cursor and insert it to the temp table. Finally I'll declare a cursor for that temp table to fetch all rows and open it at the end.

I need to know these details. Pls write to me.

- ajay
Back to top
View user's profile Send private message


Active User

Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Jul 18, 2005 5:44 pm    Post subject:
Reply with quote


(a) is more efficient it has lesser overheads.
All though, being it an outer join, (a cartisian product), you should think of optimization with putting restriction as opposed to join before restriction before join if possible.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To get Non matching row after compari... vinu78 DB2 7 Fri Jan 05, 2018 5:43 pm
No new posts DB2 catalog tables Pavan kumar chauhan DB2 8 Thu Dec 21, 2017 6:32 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us