想实现ID自增,新建了sequence、trigger,如下:
- SQL code
create sequence t_skyquality_seqminvalue 1NOMAXVALUE increment by 1start with 1NOCYCLEcache 20;CREATE or replace TRIGGER t_skyquality_trigger BEFORE INSERT ON t_skyquality FOR EACH ROW WHEN (new.id is null)begin select t_skyquality_seq.nextval into: new.id from dual;end;
在随便插入个数据时,就出现了“通信通道的文件结束”错误,最后pl/sql死掉。。
------解决方案--------------------
------解决方案--------------------
select t_skyquality_seq.nextval into: new.id from dual;
这句改成
select t_skyquality_seq.nextval into :new.id from dual;
注意冒号位置
------解决方案--------------------