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 are the copybook changes generally we done?can anyone tell me......... Thanks in advance........
How Plan is created while executing the query using SPUFI?
What is UNION,UNION ALL?
what is main use of table space and index object? please its urgent
5 Answers CA, Cap Gemini, CGI, CTS, EDS, HTC, IBM, Satyam, Syntel, TCS, Wipro,
What are the various locking levels available?
What is meant by explain?
What is reorg in DB2
How do you run JCL in cobol program
What is pagespace?
Which component is responsible for processing sql statements and selecting access paths?
How is deadlock resolved?
There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 employes........