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
Explain correlated sub-queries.
How do you stop a db2 database in linux?
Comment whether the cursor is closed during commit or not.
Is db2 a mainframe database?
What is bind package and plan in db2?
What is the physical storage length of date data type?
What is the use of db2 optimizer?
Outputs of explain are with matchcols = 0. What does this signify?
How to check last update on table in db2?
What is db2 and what is the use of db2 optimizer?
How can we retrieve the total number of records in RPG & CLLE?
Mention data types used in db2 ?
What is a db2 table?
How do I import data from excel to db2?
What is the maximum size of varchar data type in db2?