What is the syntax required for the creation of a cursor?
Answer Posted / prasad
Example For cursor Syntax:
Declare Cursor:
EXEC SQL DECLARE CUST_ITM CURSOR
FOR
SELECT
OWN_CUS_NO,
OWN_CUS_ITM_SUF_NO
FROM
NPJXTII
WHERE SCK_NO = :SCK-
NO
AND SCK_DT = :NPS-ORIG-TRANS-
DT
AND SCK_LN_ITM_SEQ_NO = :SCK-LN-ITM-SEQ-
NO
END-
EXEC.
Open Cursor:
EXEC SQL OPEN CUST_ITM
END-EXEC.
Fetch Cursor:
EXEC SQL FETCH CUST_ITM
INTO :OWN-CUS-NO,
:OWN-CUS-ITM-SUF-NO
END-EXEC.
Close Cursor:
EXEC SQL CLOSE CUST_ITM
END-EXEC.
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
How do I change the column size in db2?
How to access db2 tables in mainframe?
What is the maximum length of sqlca?
What r the comman abends in db2, jcl and cobol???????
How to check sequence on a table in db2?
What does db2 blu stand for?
What is the use of dclgen in db2?
What action db2 takes when a program aborts in the middle of a transaction?
How to restart a DB2 program?
What is a bind in db2?
How to create backup table in db2?
How to find the maximum value in a column in the db2 database?
What language is db2 written in?
ther r 2 tables OTTABLE & SALTABLE, add the otamt from OTTABLE to empsal of SALTABLE if eid is matched else add the unmatched from OTTABLE to SALTABLE
Can we update view in db2?