Quote:
|
Originally Posted by rosbur
But if I don't want to turn off autocommit, I just want to run the following piece of code in a transaction. What should I do?
|
What you're saying essentially is "I want a transaction but I don't want a transaction." A COMMIT ends the current transaction. If you have autocommit turned on it issues a COMMIT after each statement. So, the answer is: if you want to run several statements in a single transaction, turn off autocommit.