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
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 |
If one wants to update multiple rows simply write a querry,
instead of using cursor.
| Is This Answer Correct ? | 3 Yes | 0 No |
How do I import a csv file into db2?
How can record locking be achieved in those DB2 versions which do not support it?
What is the purpose of the DSNC transaction ?
Which isolation level provides maximum concurrency?
Give the name of some fields form sqlca.
Explain the use of the WHERE clause.
When would you prefer to use VARCHAR?
What is an access path?
how to fetch first 100 rows in db2
What technique is used to retrieve data from more than one table in a single SQL statement?
How does DB2 store NULL physically?
How to resolve -805 error in DB2?