I have an issue as follows.
1. I do Left Join Table A and B.
2. Insert rows into Table-B thru DB2-cobol prog.
3. Table-A has a Foreign key (e.g A-KEY) which is Primary key of Table-B.
4. The primary key of Table-B is compund key (e.g X(column)+B-KEY). B-KEY is foreign key in table_A ( A-KEY).
5. Therefore Table-B would have multiple rows like X+B-KEY, X1+BKEY...
6. Row Insert is ok as I check EXIST condition for row into Table-B before insert when key of Table-A and Table_B is matched.
PROBLEM: When a row exist on Tbale-B, row insert is successfull but fetching the same inserted row instead of going to fwtch next row (of the resultant table of left join). I handle the dup insert but the no of input rows selected shows more than the no of row selected by left join). Where as I Decalre cursor in procedure Div. using "with hold" statement.
Is there any solution to fix this issue? I need your assistance to fix it, thanks. Please reply this topic. (E-addr removed)
Best regards
Fetch inserted DB2 table row using Left Join withhold cursor
Moderators: Kalicharan, Moderator Group
DB2 Table Left join problem
Thanks for notification about email in Question.
Please reply to my DB2 problem, thanks. Bashir
Please reply to my DB2 problem, thanks. Bashir
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page