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 |
What is the difference between base table and view?
Hi this is sures. i need to practice the ibm mainframes.could u telme how can i get userid from IBM.how much cost they will collect for one user id.can send me the details please.thanq
i have a table like this : Name ADDRESS Toto 123 ... Toto 456 ToTo 678 I would like to delete 2 last row...please tell me how to delete its
how can u retrieve the data from null values using applicaion program.
What is the function of the Data Manager?
How does a cursor work?
How to create backup table in db2?
what is the difference between join and union?
which SQL comment successfully removes uncommitted changes from a DB2 database A) rollback B) delete C) drop D) decommit
why we go for SPUFI for creating tables or for sql queries?
Can one database have multiple instances?
How do you stop a db2 database in linux?