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
What is consistency token in db2?
What is the physical storage length of time data type?
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.
What is db2 catalog database?
What are db2 tables?
What is multi row fetch in db2?
How does cobol compile db2 program?
What type of database is db2?
How do you select a row using indexes in db2?
What is access path in db2?
What is the difference between using bind () and rebind () methods of naming class?
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?
What is meant by union and union all?
Explain package in db2 and its advantages?
How do I delete a table in db2?