日期:2014-05-17  浏览次数:21036 次

我写的触发器哪错了呢?
Create   or   Replace   Trigger   demo.TRIG_Demo
after   Insert   On   Tab1   For   Each   Row
Begin
When   (:new.info   like   '__________2% '   or   info   like   '___________2% ')
Begin
Insert   Into   Tab_TMP   (xm,tel,address)
                                                values(:new.xm,:new.tel,:new.address);
end;
end;

Create   or   Replace   Trigger   demo.TRIG_Demo
after   Insert   On   Tab1   For   Each   Row
Begin
if   substr(:new.info,10,1)= '2 '   or   substr(info,11,1)= '2 '   then
Insert   Into   Tab_TMP   (xm,tel,address)
                                                values(:new.xm,:new.tel,:new.address);

end   if;
end;


------解决方案--------------------
Create or Replace Trigger demo.TRIG_Demo
after Insert On Tab1 For Each Row
Begin
if substr(:new.info,10,1)= '2 ' or substr(:new.info,11,1)= '2 ' then
Insert Into Tab_TMP (xm,tel,address)
values(:new.xm,:new.tel,:new.address);

end if;
end;