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 |
When do you use the IMAGECOPY?
How do I import data from excel to db2?
What are the contents of a dclmgen?
wht steps we need will coding cobol and db2 pgm ?
how can u understand the end of the table ?
What is image copy in db2?
How does one remove entries from the SCT02 table?
have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.
5 rows are inserted to a DB2 Table. Next 3 of those are updated, then a rollback is issued. What would happen when the rollback is issued?
if one db2 pgm calls another db2 pgm. how many plans do we need. what r the steps involved..
How to view db2 table structure?
How will fetch last 5 rows from table in db2