before on --是什么句法
给你一个例子:
create trigger a_tri
before insert on a
for each row
begin
insert into b values(:new.col,...);
end;
/
给你一个例子:
create trigger a_tri
before insert on a
for each row
begin
insert into b values(:new.col,...);
end;
/
调试欢乐多
select t_useradditional_info.usertel
from t_useradditional_info
where t_user_info.key = t_useradditional_info.key)
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_76a.htm#SQLRF01405
before on 这是有问题的
before insert or update or delete on your table name
before update on NTDMWIP.EBMBM
for each row
declare
v_min NUMBER;
v_second NUMBER;
v_second2 NUMBER;
begin
if (:new.RESERSTART is not null) and (:new.RESEREND is not null) then
v_min := to_number(substr((:new.RESEREND-:new.RESERSTART)*24*60,1,11));
v_second := MOD(TO_NUMBER(SUBSTR((:new.RESEREND-:new.RESERSTART)*24*60*60,1,11)),60);
:NEW.LENDTIME:=TO_NUMBER(TO_CHAR(v_min) || '.' || TO_CHAR(v_second));
end if; if (:new.REALSTART is not null) and (:new.REALEND is not null) then
v_min := to_number(substr((:new.REALEND-:new.REALSTART)*24*60,1,11));
v_second2 := MOD(TO_NUMBER(SUBSTR((:new.REALEND-:new.REALSTART)*24*60*60,1,11)),60);
:NEW.REALTIME:=TO_NUMBER(TO_CHAR(v_min) || '.' || TO_CHAR(v_second2));
end if; if (:new.REALSTART is not null) and (:new.RESEREND is not null) and (:new.REALSTART is not null) and (:new.REALEND is not null) then
v_second := ABS(TO_NUMBER(SUBSTR((:new.REALEND-:new.REALSTART)*24*60*60,1,11)) - TO_NUMBER(SUBSTR((:new.RESEREND-:new.RESERSTART)*24*60*60,1,11)));
v_min := TRUNC(v_second/60,0);
v_second2 := MOD(v_second,60);
:NEW.DELAYTIME:=TO_NUMBER(TO_CHAR(v_min) || '.' || TO_CHAR(v_second2));
end if;
exception
when no_data_found then
null;
end TRI_CNT_EBMBM;