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 |
What is a PLAN table? How will you use it? Give the various fields of PLAN table?
What is a Database Request Module(DBRM)?
What types of tables are there in the db2 database?
in the CURSOR declare statement, if i am using an where clause and trying to compare the value with a host-varialble. EXEC SQL DECLARE C1 CURSOR FOR SELECT DEPTNO, DEPTNAME, MGRNO FROM DEPARTMENT WHERE ADMRDEPT = :ADM-DEPT Where would i need to provide value to this host-variable in the where clause. how could i pass value to this host-variable to check it.
how can we find nth max salary from A table
a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.
Bind concepts in DB2 cobol
10 Answers IBM, TCS, TRD, Virtusa,
How to fetch the last row from the table in SQL (db2)?
Explain about rct.
What type of database is db2?
How does one bind 2 versions of a CICS transaction with the same module name in two different CICS regions that share the same DB2 subsystem?
i hav created a program and moved to production but failed to create the table which is been used in the program. the program shows error as soon as it is moved or installed in production or shows error during its runtime. what is the sqlcode for this error