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
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 |
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 |
Answer / rama krishna.
UPDATE DB2 SET COL=VAR/EXPR WHERE ROWNUM<=1OO;
| Is This Answer Correct ? | 1 Yes | 7 No |
Explain package in db2 and its advantages?
What can the SET option of the Repair Utility accomplish?
What is Skeleton cursor table (SKCT)?
What is the syntax for creating a table in the db2 database?
What Utility is used to migrate DB2 from one release to the next?
Return code 100 means?
Can i insert bulk records into a db2 table using qmf of spufi only............!!!
What is read-only cursor?
What is db2 instance?
What are the different methods of accessing db2 from tso? How is the connection established between TSO & DB2?
OUTER JOINS USED TO GET MATCHING AND NONMATCHING ROWS FORM 2 OR MORE TABLES BASED ON COLUMNS. SIMPLE JOINS ALSO DO THE SAME THEN WHAT IS THE USE OF OUTER JOINS.
How many buffer pools are available in db2?