ORACLE—plsql创建触发器语句

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;

你可能感兴趣的:(oracle)