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
What is the function of logging in the db2 database?
How to retrieve rows from a db2 table in embedded sql?
What is null indicator in cobol db2?
What is copy pending and check pending in db2?
What is load replace in db2?
What is the difference between nvl and coalesce?
What is ibm db2 used for?
How can tablespace be moved to another dasd volume that is allocated for that tablespace?
What are bind parameters in db2?
How to resolve deadlock issue
What is dbrm in db2 database?
i tried to copy some records from microsoft excel to as-400 physical file through "Bosanova" emulation. Out of 14000 records only 12000 records copies and subsequently programe started to hang. Then, i closed the program forcefully. I did' under stand the problem. Also when i try to compile the physical file it is showing as "The file in use". How to overcome this problem?
What is database reorganization?
Explain about cursor stability?
What does sqlcabc has?