473,327 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

commit or rollback?

Hi all,

I'm working with tables stored by the InnoDB engine and would like to
be able to commit only if there are no errors generated by a group of
statements like this.

/* -*- sql -*- */
SET AUTOCOMMIT=0;
use db1;
begin work;
sql statement 1;
sql statement 2;
..
..
..
sql statement n;

At this point I'd like to say, in sql,
if no errors then
commit;
else
rollback
end

From what I read in the manual I can do one or the other (commit or
rollback) but there didn't seem to be a way of conditionally doing one
or the other of them.

Thanks in advance,

Colm.
Jul 20 '05 #1
0 1712

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DP | last post by:
Is there any command exists as "commit transaction" ? begin transaction < DML1 stmts > begin transaction < DML2 stmts > rollback transaction commit transaction which set of DML will be...
1
by: anders_tung | last post by:
Hi, I have a procedure which will call 3 functions. First function will update a record. Second function will delete a record. Third function will insert a record. Each function will return...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
8
by: Martin Staael | last post by:
When doing a UPDATE on a very large table it can take quite a long time due to the commit/rollback option. Is there any way on the client side to disable the commit/rollback option so that UPDATE...
3
by: Mark | last post by:
If a java applicaiton using the type 4 driver calls a DB2 stored procedure, does the stored procedure need to do its own commit when updates are completed? If the stored procedure does a commit or...
2
by: janet | last post by:
HI, I had a question on auto-commit in DB2 EEE V8 on AIX V5. Here is my example.. there are two script A.sh , B.SQL A.sh is following:
1
by: Jason Huang | last post by:
Hi, I am just wondering how do we test the transaction's Commit and Rollback? How do we simulate a situation to let the transaction fail then Rollback? Thanks for help. Jason
7
by: fyi85 | last post by:
I have 8.1.5 on Windows 2003, when I do from CLP with auto commit off: db2 update table set column=something and then db2 terminate and then db2 connect to db db2 select updated column from...
3
by: Ralf Assmann | last post by:
Hi there, we have the following problem using a DB2 version 7 on z/OS, referring also <a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.