首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

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

2013-07-08 
(转)Oracle存储过程异常处理事务特性分析SQL create or replace procedure pt1 is begin??2? ?? ? insert

(转)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

热点排行