in reply to Re: getting the ids of records affected by an input statement
in thread getting the ids of records affected by an input statement

Thanks for your reply. I can see that a 'workaround' is to do the select and find out the ids that would be affected and then do the updae. Why do you need a transaction though?
  • Comment on Re^2: getting the ids of records affected by an input statement

Replies are listed 'Best First'.
Re^3: getting the ids of records affected by an input statement
by JavaFan (Canon) on Nov 22, 2010 at 23:48 UTC
    Why do you need a transaction though?
    1. You're modifying the database. Not putting a database modification inside a transaction is far more unforgivable than not ever using strict, warnings or checking the return values of system calls. In fact, if it were my call, not putting database modifications inside transactions would put you on the fast track to getting fired.
    2. You do not want the state (or to be precise, your view) of the database to actually change between the select and the update. Hence the transaction. (I'm assuming you have a proper default isolation level active).