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 can you display the current date & current time ?

1 Answers   Cap Gemini,


What is the size of a data page?

2 Answers   IBM,


What is multi row fetch in db2?

1 Answers  


What is the use of dclgen in db2?

1 Answers  


What is the default page size of buffer pools?

1 Answers  


If the base table underlying a view is restructured, eg. attributes are added, does the application code accessing the view need to be redone?

2 Answers  


How to check sequence on a table in db2?

1 Answers  


What are the uses of db2 optimizer?

1 Answers  


What can the Locate option of the Repair Utility accomplish?

2 Answers  


What is cursor?

2 Answers  


Can we use group-by clause in sub-query? If 'yes' means,Will it be executed successfully or else If 'no' means why should we not using that method? Give me your suggestion please....

1 Answers  


What is null value in db2?

1 Answers  


Categories