what is the syntax for FOR UPDATE CLAUSE in cursor
declaration and how can u update using cursor? is it
possible to update multiple rows at a time.

Answer Posted / vaneesh khurana

EXEC SQL
DECLARE STUDENT-CSR CURSOR
SLECT NAME, CLASS, MARKS, STATUS
FROM STUDENT-TABLE
WHERE ROLL-NO = :WS-ROLL-NO
FOR UPDATE OF STATUS
END-EXEC

EXEC SQL
UPDATE STUDENT-TABLE SET STATUS =:WS-STATUS
WHERE CURRENT OF STUDENT-CSR
END-EXEC

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multi row fetch in db2?

603


Explain in brief how does db2 determine what lock-size to use?

595


When reorg is used?

672


Can there be more than one cursor open for any program?

659


How to connect to db2 database from windows command line?

562






How do you pull up a query which was previously saved in qmf?

672


Highlight all the advantages that are attached to a package.

627


How do I add a column in db2?

591


Differentiate between cs and rr isolation levels? Where do you specify them?

581


Define declaration generator (dclgen).

665


What is the cobol picture clause of the db2 data types date, time, timestamp?

615


What is a bind in db2?

592


What is an instance in db2?

563


Is it possible to create an Instance in DB2 using DB2 Control Center ?

630


How to find the maximum value in a column in the db2 database?

611