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


Please Help Members By Posting Answers For Below Questions

List out the three types of page locks that can be held.

678


How to retrieve rows from a db2 table in embedded sql?

712


How can the firstname and the lastname from the emp table be concatenated to generate complete names?

735


How many types of page locks can be held in db2?

583


What does db2 mean?

577






What do you mean by rollback?

564


What is package in db2 mainframe?

549


Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?

617


What is the use of dclgen in db2?

583


What is db2 purescale?

537


Is ibm db2 open source?

576


What is view db2?

616


What is buffer pool and list some of them?

620


What are packages in db2?

590


What is db2 bind?

631