suppose in my table 10 rows are there , i want to update odd
rows salary as 90000 ? how u do it ? any one help me ? what
do we use here cursor-fetch or normal sql ?
Answer Posted / krishna
Declare:
EXEC SQL
DECLARE CURSOR C1 FOR SELECT SAL FROM EMP FOR
UPDATE SAL
END-EXEC.
OPEN:
OPEN C1
FETCH:
PERFORM UNTILL SQLCODE=100
FETCH C1 INTO :SAL
UPDATE EMP SET SAL=9000 WHERE CURRENT OF C1
FETCH C1 INTO :SAL
END-PERFORM
| Is This Answer Correct ? | 10 Yes | 13 No |
Post New Answer View All Answers
Is ibm db2 free?
What happens in bind step in a db2 program?
Mention data types used in db2 ?
How to get the ddl of a table in db2?
How can record locking be achieved in those DB2 versions which do not support it?
What is access path in db2?
What is the advantage in De-normalizing tables in DB2?
How does cobol compile db2 program?
Mention the definition of cobol in varchar field.
What is the use of db2 optimizer?
List out the data types available.
How do you pull up a query which was previously saved in qmf?
Is it possible to create an Instance in DB2 using DB2 Control Center ?
How can tablespace be moved to another dasd volume that is allocated for that tablespace?
What is copy pending and check pending in db2?