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

I have 1000 rows in a db2 table.I want to update first 100
records,How do I do it?

Answer Posted / ananth

Declare a cursor like this in the application program
exec sql
Declare empcur cursor with hold for
select empno,empname from emp
for update of empsal
fetch first 100 rows only
end-exec.
this query will retrieve the first 100 rows and the cursor
is positiond at the first row in the resultent table.

Is This Answer Correct ?    23 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the syntax for seeing the columns and data types of a table in the db2 database?

1163


Are views updateable?

1148


What does db2 plan contain?

1017


Which component is used to execute the sql statements?

1094


Explain the function done by data manager?

1273


Which component is responsible for processing sql statements and selecting access paths?

1125


What is the meaning concurrency in the db2 database?

1108


What is lock escalation in db2?

1027


I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.

3198


What is copy pending and check pending in db2?

996


Can there be more than one cursor open for any program?

1165


What is the use of commit in db2?

1071


If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?

1144


What is reorg and runstats in db2?

1213


What is db2 catalog database?

1034