when we are tying to update a table having 100 rows. if the
program abends when updating 51 row . how to start updating
again from the 51 row .what was the logic
Answer Posted / abhijit18in2002
when we are tying to update a table having 100 rows.
if the program abends when updating 51 row . how to start
updating again from the 51 row .
what was the logic
Ans: The Possible answer would be..if you had used COMMIT
before 51st ROW .. the Former records
would have been updated in the table .. If No COMMIt was
used.. The whole transaction would have been
ROLLBACKED.
Now If you want to start a fresh Transaction and want to
start Updating directly from 51st Row
Then There are two ways
1> Perform a loop to scroll till u have read 50 rows
Then Point ur cursor as CURRENT to the 51st Row
Start Updating the Records Till end of table.
or
2> Declare a Scrollable cursor & use FETCH ABSOLUTE option
to fetch a particular row directly
EXEC SQL FETCH ABSOLUTE +51 C1
INTO :TEMP1, :TEMP2, :TEMP3;
this statement fetches the 51st row of the Table
| Is This Answer Correct ? | 8 Yes | 5 No |
Post New Answer View All Answers
How can the firstname and the lastname from the emp table be concatenated to generate complete names?
Comment whether dclgen is mandatorily used. If not, then what is the point of using it?
What are iseries servers?
For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.
How can we retrieve the total number of records in RPG & CLLE?
Mention the location where the output received from explain statement is stored.
can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well
If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?
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 the difference between drop table and delete table?
What is the clustering index in the db2 database?
What is runstats and reorg in db2?
What is deadlock in db2?
What is declare cursor?
What is commit in db2?