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 Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts To know activities on db2 tables ashek15 DB2 4 Fri Mar 03, 2017 11:23 pm
No new posts ERM-Diagram of SysIBM-Catalog-Tables Auryn DB2 2 Fri Feb 17, 2017 6:22 pm

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