读书人

(转)Oracle存储过程错误处理事务特性

发布时间: 2013-07-08 14:13:00 作者: rapoo

(转)Oracle存储过程异常处理事务特性分析

    SQL> create or replace procedure pt1 is begin
    ??2? ?? ? insert into t1 values(1,1);
    ??3? ?? ? SAVEPOINT PT1;
    ??4? ?? ? INSERT INTO T1 VALUES(2,2);
    ??5? ?? ? SAVEPOINT PT2;
    ??6? ?? ?EXCEPTION
    ??7? ?? ???WHEN OTHERS THEN
    ??8? ?? ?? ?ROLLBACK TO SAVEPOINT PT1;
    ??9? ?? ?--commit;
    10? ?? ?insert into t1 values(3,3)
    11? ???end;
    12??/
    警告: 创建的过程带有编译错误。

但是对于commit命令,看来Oracle是比较宽容的了。

来源:http://www.itpub.net/thread-1563051-1-1.html

读书人网 >其他数据库

热点推荐