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
List down the types of triggers in the db2 database?
What does db2 stand for?
What is rct?
How does db2 sample database connect?
Define predicate?
How to take backup of table in db2?
How would you find out the total number of rows in a db2 table?
How can you count the number of rows from a table tab?
Which component is responsible for processing sql statements and selecting access paths?
What is host variable?
What is db2 bind process?
Is ibm db2 open source?
How to find schema of a table in db2?
What is bind and rebind in db2?
What is the default page size of buffer pools?