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

what is the maximum number of tables that can be joined ?

8 Answers   IBM, TCS,


What is db2 optimizer?

0 Answers  


Give the COBOL definition of a VARCHAR field.

2 Answers  


What is image copy?

1 Answers   Virtusa,


Can you search give an array in the WHERE clause of a db2 query?

1 Answers  






I have some 3 particular fields ..i want to know which all tables have those 3 fields. Is there any way to identify.. can we know by quering system tables..

5 Answers   CTS,


Can a array declared with an index be displayed(readable format) in spool?

4 Answers   Syntel, UST,


DB2: A calls B once sucessfull and second time when it calls says curson is open why is it so?

1 Answers   IBM,


What's the maximum number of characters that a tablename can have?

3 Answers  


What are the four lockable units for DB2?

1 Answers  


In cursor program perform para varying until 1 by 1 fetch para cursor------close para in the blank what will come for confirming in the database?

1 Answers   HCL,


What is the use of dclgen in db2?

0 Answers  


Categories