Page 1 of 1

Query Related To Cursor.

PostPosted: Mon Oct 04, 2010 8:38 pm
by Vineet
Hi All,

I am having a Query. What is difference between For Update Statement in Cursor & Normal Update Statement, which is issued to Update table base on Certain Criteria. How To Judge when to use 'For Update' Statement & when to Use 'Normal
Update' statement. If Possible Support Answer with Example.

Thanks
Kind Rgds

Vineet Anand

Re: Query Related To Cursor.

PostPosted: Mon Oct 04, 2010 11:02 pm
by NicC
You use a cursor to loop through multiple rows that you may, or may not, update. Coding update on the cursor lets DB2 know that rows may be updated.

The UPDATE statement actually updates the row currently being processed.