SQL: Want to update multiple rows, but roll back if any of the updates fails.

Let's say i want to do 3 updates. The second update is not valid(the key doesn't exist in the db).
So i want to roll back all 3 updates.
connection.setAutoCommit(false);
3 updates
connection.commit()


Will that work
renisenbbAsked:
Who is Participating?
 
Walter RitzelSenior Software EngineerCommented:
Yes, it will work.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.