Doubt in 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
nrajini
Member
Posts: 23
Joined: Sun Oct 05, 2008 4:35 pm

Doubt in cursor

Post by nrajini » Sat Nov 01, 2008 9:55 pm

Hi,

Kindly Clarify..

If we are passing a value to host variable do we have to move the value before Open cursor or do we have to move it after Open cursor..

Thanks,
Rajini

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

Post by dbzTHEdinosauer » Sat Nov 01, 2008 11:12 pm

before
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Sun Nov 02, 2008 6:15 am

while executing the program, sql statement wont execute at DECLARE step... program executes the SQL in the DECLARE statement, when it encounters OPEN statement.

so... you need to give the value to host variable before OPEN statement.
Natarajan
Chennai

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

Post by dbzTHEdinosauer » Sun Nov 02, 2008 2:57 pm

DECLARE's are used by the SQL-Precompiler to generate the data areas that are used in the CALL's generated by SQL Statements other than DECLARE's.
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

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



Other References
Mainframe Tools and others