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?

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / brooks

is there identity column in this table, for example, if
there is a column indexnum int(supposed start from 1), you
can use the Update Table Set XXX=XXX where indexnum < 101

Is This Answer Correct ?    0 Yes 6 No

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

Answer / rama krishna.

UPDATE DB2 SET COL=VAR/EXPR WHERE ROWNUM<=1OO;

Is This Answer Correct ?    1 Yes 7 No

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

Answer / sireesha

SELECT * FROM TABLE WHERE COUNT(*) = 100;

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More DB2 Interview Questions

What if we try to insert the base table through updatable view , but failed to give a column value which is defined as NOT NULL.

1 Answers   Cap Gemini,


Q4. How will you get the count of record without using COUNT verb in query?

2 Answers   IBM,


a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.

3 Answers  


What is host variable in db2 cobol?

0 Answers  


What is a page?

2 Answers  


what is a collection?

2 Answers  


What is a DB2 plan?

8 Answers  


What is the FREE command?

1 Answers  


Which isolation level provides highest data integrity?

0 Answers  


Which is faster delete or truncate?

0 Answers  


What is a LIKE table and how is it created?

2 Answers  


What is the function of logging in the db2 database?

0 Answers  


Categories