存储过程里的事务操作:
temp varchar2(1000); /**//*定义临时变量*/ is begin select code into p_count from table1 where a=p_a; /**//*查询并返回值*/ temp := p_count; /**//*将返回值赋给临时变量*/ savepoint point1; /**//*保存点*/ insert into table2(a,b)values(temp,p_b); /**//*将临时变量值添加到新表的字段*/ savepoint point2; insert into exception when others then rollback to savepoint point1; /**//*异常处理,保存点下面的操作都不会被执行*/ return; end; |
|