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
What is the difference between drop table and delete table?
Mention data types used in db2 ?
DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?
If I have a view which is a join of two or more tables, can this view be updateable?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
What does db2 stand for?
Why do we need reorg in db2?
What is commit in db2?
What is the use of predicate?
What is a plan and package in db2?
Name the various locking levels available?
How can you count the number of rows from a table tab?
Is db2 free?
How to create db2 table in mainframe?
Is db2 a mainframe database?