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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is database reorganization?

591


What do you mean by storage group (stogroup)?

583


i want to maintain uniqueness on pdf without make lf??????????

1635


What is table space in db2?

584


Explain the function done by data manager?

857






How do you simulate the explain of an embedded sql statement in spufi/qmf?

637


What is null indicator in cobol db2?

585


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.

1237


What does reorg do in db2?

578


What is database manager in db2?

551


What are db2 tables?

649


define clustering index.

617


What is difference between alias and synonym in db2?

644


Explain what are the various isolation levels possible?

610


What are the contents of dclgen?

659