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...

can we update the table by using cursors can anyone post
the query?

Answer Posted / amar

DECLARE
INT NUMBER:=0;
CURSOR C1 IS
SELECT COL1,COL2 FROM TABLE_NAME;
BEGIN
FOR RC IN C1 LOOP
UPDATE TABLE_NAME SET COL_NAME=RC.COL1,COL_NAME=COL2;
CNT:=CNT+1;
END LOOP;
END;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of db2 optimizer?

1223


When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?

3520


What is explain in db2?

958


What is the role of data manager in the db2 database?

1051


Outputs of explain are with matchcols = 0. What does this signify?

991


What is the physical storage length of timestamp data type?

1025


Is it possible using max on a char column?

1084


What is role in db2?

1040


What does runstats do in db2?

1023


What is bind in db2?

975


What do you mean by commit and rollback?

974


Mention the way of highlighting as well as putting a cursor to use in a cobol program.

1018


How can we read records for specific member in CL? AND rpg?

644


What is db2 connect?

1008


Explain about rct.

1024