日期:2014-05-17 浏览次数:20869 次
create or replace trigger con_sex_trigger
before insert on consumer for each row
declare
ex_con_sex exception;
begin
if :new.con_sex not in ('m','f') then
raise ex_con_sex;
end if;
exception
when ex_con_sex then
dbms_output.put_line('con_sex只能是m或者f');
end;
create or replace trigger con_sex_trigger
before insert on consumer for each row
declare
begin
if :new.con_sex not in ('m','f') then
raise_application_error(-20002, 'con_sex只能是m或者f!!');--异常抛出
end if;
end;