oracle触发器的问题
柱子89 2012-08-10 05:38:29 create or replace trigger testTr
before insert
on result_test
for each row
declare value number;
direction number;
begin
select cg.value into alarmvalue from cgtest cg where cg.id=3;
if(:new.state >= value) then
begin
delete from eatest ea where ea.id=:new.id and ea.flag=0;
select ps.direction into direction from pstest ps where ps.id = :new.id;
insert into eatest(id,time,type,direction,status,description,flag)
values
(:new.id,:new.time,3,direction,:new.state,'test',0);
end;
end if;
end;
我觉的这个红色的地方使用有错误,这样使用正确吗?