Interview Questions   Tutorials   Discussions   Programs   

DB2 - Is it Possible to declare or create a cursor for UPDATE of table?




577
views
asked mar September 10, 2014 01:25 PM  

Is it Possible to declare or create a cursor for UPDATE of table?


           

1 Answers



 
answered By Mswami   0  

Yes, you can declare a cursor using the FOR UPDATE OF clause.

Example:

EXEC SQL                                
    DECLARE CURUPDT1 CURSOR FOR         
        SELECT NAME,SEQ FROM IBMGRP.MYNAM
        WHERE SEQ = :WS-SEQ             
        FOR UPDATE OF NAME              
END-EXEC.      

Here, we can update the NAME field of the MYNAM table.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert