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

What is runstats and reorg in db2?

798


How to access db2 tables in mainframe?

615


What is commit in db2?

596


Which are the db2 tools to protect integrity of the database?

692


What is the difference between db2 and oracle?

677






What are the rules for db2 programming?

641


What does db2 stand for?

598


When the like statement is used?

640


How to run db2 command in windows?

652


What is difference between alias and synonym in db2?

643


How can you do the explain of a dynamic sql statement?

637


What are packages in db2?

597


what is db2 restart?

1693


How do you simulate the explain of an embedded sql statement in spufi/qmf?

634


What are the uses of db2 optimizer?

817