DB2 Cursor

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
Posts: 6
Joined: Wed Jun 27, 2007 5:02 pm

DB2 Cursor

Post by govardhan » Wed Jun 27, 2007 5:18 pm

Assume that for sure the declared cursor will not fetch any records, then in this case what will be the sql code during opening of this cursor.

User avatar
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Jun 27, 2007 5:34 pm

assuming you have a good connect with db2, you are authorized, good bind, plan etc...
the open will return an SQL code of 000.
the first fetch will return a +100.

the size (or lack) of results table (number of rows returned) has nothing to do with the open.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply


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.
Mainframe Interview questions

Other References
Mainframe Tools and others