3

I have a MySQL stored procedure which reads and updates multiple tables, so I want it to be a transaction. Is it already transactional by default? Or do i need to do something?

MySQL 5.0+

1 Answer 1

4

I don't believe so. According to the manual section on BEGIN...END statements:

Within all stored programs (stored procedures and functions, triggers, and events), the parser treats BEGIN [WORK] as the beginning of a BEGIN ... END block. Begin a transaction in this context with START TRANSACTION instead.

Also see the manual on START TRANSACTION, COMMIT, and ROLLBACK Syntax.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.