mysql & oracle savepoint 使用方法
oracle savepoint:
begin
savepoint a;
insert into ages values(1,'age');
insert into ages values(1,'age');
insert into ages values(1,'age');
insert into ages values(1,'age11111111111111111111111111');
exception when others then
begin
rollback to a;
end ;
commit;
end ;
mysql savepoint :
start transaction;
savepoint a;
insert into t set id =10;
insert into t set id =21;
insert into t set id =31;
rollback to savepoint a;
start transaction;
set @b=0;
declare continue handler for SQLEXCEPTION set @b=1;
savepoint a;
insert into t set id =10;
insert into t set id =21;
insert into tt set id =31;
if @b=1 then
rollback to savepoint a;
end if;
begin
savepoint a;
insert into ages values(1,'age');
insert into ages values(1,'age');
insert into ages values(1,'age');
insert into ages values(1,'age11111111111111111111111111');
exception when others then
begin
rollback to a;
end ;
commit;
end ;
mysql savepoint :
start transaction;
savepoint a;
insert into t set id =10;
insert into t set id =21;
insert into t set id =31;
rollback to savepoint a;
start transaction;
set @b=0;
declare continue handler for SQLEXCEPTION set @b=1;
savepoint a;
insert into t set id =10;
insert into t set id =21;
insert into tt set id =31;
if @b=1 then
rollback to savepoint a;
end if;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-609493/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle with使用方法以及遞迴Oracle遞迴
- (3) MySQL分割槽表使用方法MySql
- Oracle 轉MySqlOracleMySql
- postgresql和mysql中的limit使用方法MySqlMIT
- RedHat下MySQL的基本使用方法分享RedhatMySql
- [Oracle-> MySQL] Oracle通過dblink連線MySQL--Oracle 19c連線到MySQL 5.7OracleMySql
- 全棧 – 11 資料庫 MySQL使用方法全棧資料庫MySql
- Oracle和Mysql遞迴OracleMySql遞迴
- Oracle MYSQL PG體系OracleMySql
- Oracle MySQL PG選型OracleMySql
- Oracle MySQL PG主從OracleMySql
- mysql 大表中count() 使用方法以及效能優化.MySql優化
- MySQL傳輸表空間的簡單使用方法MySql
- 詳解MySQL資料備份之mysqldump使用方法MySql
- 詳解MySQL中的SQRT函式的使用方法MySql函式
- MySQL和Oracle的區別MySqlOracle
- mysql與Oracle的區別MySqlOracle
- Oracle和MySQL的區別OracleMySql
- oracle定時任務dbms_job與dbms_scheduler使用方法Oracle
- laravel mysql聚合函式使用方法(count,sum,max,min,avg)LaravelMySql函式
- Flink CheckPoint狀態點恢復與savePoint機制對比剖析-Flink牛刀小試
- 異構資料庫資料遷移 oracle to mysql之oracle sqlloader和mysql load data資料庫OracleMySql
- MySQL 06 mysql 如何實現類似 oracle 的 merge intoMySqlOracle
- 配置Oracle DBlink連線MySQL庫OracleMySql
- mysql和oracle計劃任務MySqlOracle
- Oracle和MySQL md5加密OracleMySql加密
- 多表關聯更新(mysql,oracle,postgreSQL)MySqlOracle
- 使用一個Oracle MySQL的理念OracleMySql
- 配置ogg異構oracle到mysqlOracleMySql
- 鐵威馬NAS連線MySQL資料庫使用方法教程MySql資料庫
- mysqldump使用方法(MySQL資料庫的備份與恢復)MySql資料庫
- MySQL Batched Key Access (BKA)原理和設定使用方法舉例MySqlBAT
- mysql8 公用表表示式CTE的使用方法例項分析MySql
- Oracle、mysql資料庫增、刪、改OracleMySql資料庫
- flink-cdc實時同步(oracle to mysql)OracleMySql
- MySQL、Oracle後設資料抽取分析MySqlOracle
- Oracle 和 mysql的9點區別OracleMySql
- mysql Innodb表空間解除安裝、遷移、裝載的使用方法MySql
- MySQL中的alter table命令的基本使用方法及提速最佳化MySql