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 default page size of buffer pools?
What is collection in db2 bind?
What is cursor with hold option in db2?
What are foreign keys in db2?
Mention the location where the output received from explain statement is stored.
What is release/acquire in bind?
What is the difference between using bind () and rebind () methods of naming class?
What is the role of union all and union
What is with ur in db2?
run jcl for cobol+db2 pgm?.. //jobcard //step001 exec pgm=ikjeft01 //systin dd * DSNSYSTEM(--------) RUN PROGRAM(MYPGMNAME) PLAN(-----), LIB(-------), PARMS(------) /* WHAT WILL U GIVE INSIDE THE BRACKETS... WHAT IS PLAN,PACKAGE,BIND?..PLAN N PACAKGES ARE GENERATED BY ?...
What is dpf in db2?
What is the reason behind not using select * in embedded sql programs?
What is copy pending status in db2?
Differentiate between cs and rr isolation levels? Where do you specify them?
Why select is not preferred in embedded sql programs?