日期:2014-05-16 浏览次数:20513 次
create table test ( id number not null, name varchar2(64), code varchar2(18) )
creater or replace trigger tg_test before update of code on test for each row declare cnt number; exp_err exception; begin select conut(*) into from test where (code is not null) and code=:new.code; if cnt!=0 then raise exp_err; end if; exception when exp_err then raise _application_error(-22222,'重复'); end;