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

Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?

2685


Explain the contents that are a part of dclgen.

655


How to resolve deadlock issue

17966


What is dbrm? What it contains?

679


How can the firstname and the lastname from the emp table be concatenated to generate complete names?

744






Define check constraint.

642


How to get the ddl of a table in db2?

675


What is an instance in db2?

563


What is buffer pool?

607


Explain packages.

660


Define buffer pool.

625


How to compare data between two tables in db2?

658


How can you quickly find out the # of rows updated after an update statement?

630


File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?

2375


What is a bind in db2?

590