IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2 Cursor, Reading two tables record by record


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijendra.23

New User


Joined: 06 Apr 2007
Posts: 3
Location: bangalore

PostPosted: Sat Aug 25, 2007 1:23 pm
Reply with quote

Hi all ,
can anyone suggest me regarding below condition:

There are two Table - A and Table -B. Now i want to take first row of table A and comes to table B ,Read all records from Table B then at the end of B, i want to go back to table A and read second record of Table A then all record of B like wise till end of table A.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Aug 25, 2007 1:31 pm
Reply with quote

Hello,

Why would you want to generate a cartesian product?

What you want to do is prevented whenever possible.

Why do you need to read table 2 over and over?
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 631
Location: Wisconsin

PostPosted: Sat Aug 25, 2007 8:24 pm
Reply with quote

A proper join statement is probably more correct. Don't treat the database tables like files.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts To Discard record with 0 entry if Dup... SYNCSORT 7
No new posts Question regarding ISPF tables with T... TSO/ISPF 11
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
No new posts To join 2 tables and to join 3rd tabl... DB2 8
Search our Forums:


Back to Top