create or replace trigger TIB_T_EXAM before insert on t_exam for each row declare integrity_error exception; errno integer; errmsg char(200); dummy integer; found boolean; begin -- Column ID uses sequence SEQ_T_EXAM select SEQ_T_EXAM.NEXTVAL INTO :new.ID from dual; -- Errors handling exception when integrity_error then raise_application_error(errno,errmsg); end TIB_T_EXAM;原文链接:https://www.f2er.com/oracle/212871.html