oracle 插入ID自增遇到ORA-03113

阅读更多

      oracle 插入数据时,id自增,采用触发器方式,不知何原因,遇到ORA-03113,提示数据库连接断开,无法提交。

触发器代码

create or replace trigger autoIncreaseT before
insert on IP for each row //IP为表名
when(new.id is null)
begin
select SEQ_global.nextval into:new.id from dual;
end

 插入数据

insert into IP(begin_IP,end_IP) 
(select begin_ip,end_IP from report_IP)

 

删除触发器,直接写sql语句方式,运行正常

insert into IP(ID,begin_IP,end_IP)
(select SEQ_global.nextval,begin_IP,end_IP from report_IP);
 

 

参考

 

你可能感兴趣的:(oracle 插入ID自增遇到ORA-03113)