Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is phantom read in db2?

1085


What is the use of commit in db2?

1012


Define check constraint.

1036


How do you concatenate the firstname and lastname from emp table to give a complete name?

1028


What does reorg do in db2?

990


Why do we use cursor?

1056


Give the name of some fields form sqlca.

1033


Define declaration generator (dclgen).

1072


How can tablespace be moved to another dasd volume that is allocated for that tablespace?

1194


What is db2 optimizer?

1190


Explain how can you do the explain of a dynamic sql statement?

1072


What is bufferpool in db2?

995


How to execute stored procedure in db2 command editor?

999


How can you validate Sql errors during cursor operation in db2 pgms and where do you code?

2177


What is a collection in db2?

997