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 |
Is it mandatory to use DCLGEN? If not, why would you use it at all?
What is the use of commit in db2?
What is universal database?
What is pagespace?
What is DYNSLT keyword? How do you perform selection using DYNSLT
What is Reorg Recovery? when will you run it?
What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
What is the syntax of SELECT statement when embedded in a COBOL program?
How do you run JCL in cobol program
How to get the ddl of a table in db2?
If we have 100 records in the PF, we deleted all the records then what is the Size of the PF?