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

Is ibm db2 free?

995


What happens in bind step in a db2 program?

958


Mention data types used in db2 ?

1142


How to get the ddl of a table in db2?

1118


How can record locking be achieved in those DB2 versions which do not support it?

1061


What is access path in db2?

970


What is the advantage in De-normalizing tables in DB2?

1152


How does cobol compile db2 program?

1034


Mention the definition of cobol in varchar field.

1227


What is the use of db2 optimizer?

1087


List out the data types available.

1132


How do you pull up a query which was previously saved in qmf?

1138


Is it possible to create an Instance in DB2 using DB2 Control Center ?

1083


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

1221


What is copy pending and check pending in db2?

986