写一个drop你这些表的procedure,然后在发生异常之后调用此procedure令其drop所有table伪代码:create or replace p_drop is begin drop table table1; drop table table2; ... ... end;从文件中解析的数据在数据库中创建表: begin create table1.... create table2.... .... .... exception when others then p_drop; end;
创建表是DDL操作,隐式自动提交,没有回滚操作 1:但是你可以这样做,在你创建表之前先check point 设置保存点,然后失败或者异常的话就 ROLLBACK 回保存点 2:删除你创建的表。。
ddl语句没有回滚的 不过你可以按照2楼的方法在创建表之前设置保存点。 然后rollback to 保存点名
is
begin
drop table table1;
drop table table2;
...
...
end;从文件中解析的数据在数据库中创建表:
begin
create table1....
create table2....
....
....
exception when others then
p_drop;
end;
1:但是你可以这样做,在你创建表之前先check point
设置保存点,然后失败或者异常的话就 ROLLBACK 回保存点
2:删除你创建的表。。
不过你可以按照2楼的方法在创建表之前设置保存点。
然后rollback to 保存点名
另外 你可以做batch处理 然后回滚