Updating multi tables within a cursor

  • I need to update three tables and I am using a cursor.  I want to update all 3 tables within the same cursor.  Is it possible? or I will have to write 3 separate cursors to update these tables.

    Any help will be greatly appreciated.

    Thank you

  • You can do this in one cursor. Technically it is possible. The question is why to use cursor in the first place. Check if a SQL without a cursor can do the same trick.

    The rule should be: NEVER use cursors. Cursors are bad from the system performance stand point. Unless you are cornered to use them because of some strange DB design constrains.

    And if you have to loop then in 99% of the cases you can get it done without the cursor as well.

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply