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 |
How do I delete a table in db2?
What is the syntax for seeing the columns and data types of a table in the db2 database?
Hi , I am posting some interview ques . what is the use of cursors ? what is the diff between select and cursor ? bith are used for data retrival .. rite?
What is the self-referencing constraint?
What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?
When reorg is used?
Which isolation level provides highest data integrity?
How do you check for a null value in a db2 column?
In cobol+DB2program if the code of cobol program has changed than i have to do precompilation once again?
What are the various data types available in db2?
What is filter factor?
Where can you declare a cursor in a cobol-db2 program?