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.

Answers were Sorted based on User's Feedback



what is the syntax for FOR UPDATE CLAUSE in cursor declaration and how can u update using cursor? ..

Answer / 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

what is the syntax for FOR UPDATE CLAUSE in cursor declaration and how can u update using cursor? ..

Answer / vaneesh khurana

If one wants to update multiple rows simply write a querry,
instead of using cursor.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More DB2 Interview Questions

How to compare data between two tables in db2?

0 Answers  


Is the primary key a clustered index?

0 Answers  


List some fields from sqlca?

0 Answers  


can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well

0 Answers  


What are the various locking levels available?

3 Answers  






What is the difference between bind and rebind in db2?

0 Answers  


What is a collection?

3 Answers  


In db2, how do you insert multiple rows in 1 query using a.) Cursors, b.) Normal query?? Give syntax for both.

5 Answers   CTS,


What is the purpose of the QUIESE Utility?

1 Answers  


how can i pull up a query which was previously stored in qmf

3 Answers  


What is the meaning concurrency in the db2 database?

0 Answers  


What is catalog database in db2?

0 Answers  


Categories