MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

avoiding cursor and coding for a new query

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Nov 10, 2006 3:07 pm    Post subject: avoiding cursor and coding for a new query Reply with quote

Hai All,

I have a COBOL DB2 Program and i am generating a output file which has one record for each employee number by getting data from DB2 table but with 5 different cursors and each cursor is getting the desired fields which are required for generating the output file but with Employee number as a common field in all the cursors and each cursor is using different tables.Now i want to avoid using cursors in the program and i would like to generate the file by unload the data from DB2 table using utility which will retreive me all the information pertaining to a single employee number by number.

I am in the assumption to code new query as exactly as present in the cursor query doing some minor cosmetic modifications (just copying).Is this the efficient way of doing it or should i need to check all 5 cursors query what fields they are retreiving and code a query which gets me all the info.Please suggest me in this regard.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Nov 10, 2006 4:29 pm    Post subject: Reply with quote

shekar123,

Option 1:

1. unload all the 5 tables with required columns
2. Use sort/easytrieve to match and combine the 5 records into a single record.

Option : 2

1. Code a sql joing all the 5 tables in a single query and unload it. If the tables have huge data then the peformance will be terrible with the join.


Post your cursor queries and let me check if we can come up a singleton sql to unload from all the 5 tables.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group