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 consistency token in db2?

640


What is the physical storage length of time data type?

673


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.

2757


What is db2 catalog database?

582


What are db2 tables?

647






What is multi row fetch in db2?

604


How does cobol compile db2 program?

608


What type of database is db2?

523


How do you select a row using indexes in db2?

645


What is access path in db2?

562


What is the difference between using bind () and rebind () methods of naming class?

792


Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?

6848


What is meant by union and union all?

587


Explain package in db2 and its advantages?

594


How do I delete a table in db2?

647