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

How do I copy a table in db2?

575


What is a storage group (stogroup)?

778


How to connect to db2 database from windows command line?

564


What is declare cursor?

614


What is the use of db2 optimizer?

611






What is the difference between bind and rebind in db2?

858


Which command is used to connect to a database in DB2 ? Give the Syntax.

602


In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?

583


How can the duplicate values be eliminated from db2 select?

633


How do I change the column size in db2?

598


What is dclgen in db2?

681


What is the physical storage length of date data type?

732


What are the different types of base tables?

587


i want to maintain uniqueness on pdf without make lf??????????

1637


What is catalog database in db2?

646