Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do transactions?

Status
Not open for further replies.

wgcs

Programmer
Mar 31, 2002
2,056
EC
How does one deal with transactions in MySql through ODBC?

Can you send several statements in one ODBC SQLEXEC() and have them protected by a transaction (so all of them or none of them are committed)?

Can you have a transaction span several ODBC SQLEXEC() calls?
 
It's my understanding that transactions are not available with MySQL when using the standard MyISAM tables.

InnoDB tables will allow you to do transactions by allowing the Commit and Rollback commands. Basically, the queries are done in a buffer and when a commit is executed, the buffer updates are commited to the database. A Rollback will undo those updates.

Any Query done before a commit will be part of the transaction. Therefore, a commit has to be done even after a single query (that wouldn't normally be thought of as part of a transaction).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top