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 does db2 sample database connect?

0 Answers  


if i made sme changes in sub pgm wht r the things to be done for this ?

1 Answers   TCS,


what is REORG? what is the use?

4 Answers  


How to execute stored procedure in db2 command editor?

0 Answers  


Give the COBOL definition of a VARCHAR field.

2 Answers  






What is the self-referencing constraint?

2 Answers  


Is db2 relational database?

0 Answers  


What is error -818 in db2. where can you find the timestamp of the DBRM and the source code.( precompile puts the timestamp on dbrm and source code correct?)

2 Answers  


Outputs of explain are with matchcols = 0. What does this signify?

0 Answers  


What is COPY PENDING status?

6 Answers  


What is host variable in db2 cobol?

0 Answers  


Consider that a package is bound into 2 different collections and the PKLIST option specifies both the collections. If the collection id is not specified in the program while executing the SQL query, then when the DB2 system will search the package list, which collection will it pick up or will it give an error/abend?

1 Answers  


Categories