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 cursor stability?

1 Answers  


What is the usage of open cursor command?

0 Answers  


query to just fetch first matching row and stop execution. once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop

2 Answers   IBM,


What techniques are used to retrieve data from more than one table in a single SQL statement?

2 Answers  


How do you prepare a COBOL + DB2 program from coading till execution ?

1 Answers   Amdocs, Xansa,


Can DB2 be accessed by TSO users? If yes, which command is used to invoke DB2?

1 Answers  


i have table agdet i want first 5 maximum commission which query will you write for this thanks in advance

3 Answers  


Can DASD types assigned to storage groups be intermixed (i.e., 3350s and 3380s)?

1 Answers  


DB2 is a A) data base/data communication system B) data base C) RDBMS D) Programming language

4 Answers   Accenture,


What are delete-connected tables?

1 Answers  


we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?

2 Answers  


What is meant by explain?

0 Answers  


Categories