What is the syntax required for the creation of a cursor?
Answer / 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 |
Are views updateable?
What is the STOSPACE Utility used for?
what's the error code for Unique Index Violation?
How to design maps
What is the difference between IN subselects and EXISTS subselect?
Can i insert bulk records into a db2 table using qmf of spufi only............!!!
How to get the ddl of a table in db2?
What action db2 takes when a program aborts in the middle of a transaction?
How do I optimize a query in db2?
What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the queries be used in EXPLAIN command to check the performance.
How do you leave the cursor open after issuing a COMMIT? (for DB2 2.3 or above only)
How will fetch last 5 rows from table in db2