Query Related To Cursor.



IBM's flagship relational database management system

Query Related To Cursor.

Postby Vineet » Mon Oct 04, 2010 8:38 pm

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
Vineet
 
Posts: 86
Joined: Tue Jun 19, 2007 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Query Related To Cursor.

Postby NicC » Mon Oct 04, 2010 11:02 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post