create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS :=old.STATUS;
if STATUS := 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;
第5行出现错误。代码未编译。
这是一项学术任务。
答案 0 :(得分:1)
从if语句的等式中删除:
:=表示您的分配值就像您在old.status
create or replace trigger check_status BEFORE update on LDS_PLACEMENT
for each row declare STATUS LDS_PLACEMENT.STATUS%type;
begin
STATUS := :old.STATUS;
if STATUS = 'Closed' then
raise_application_error(-20111,'Sorry the placement is closed');
end if;
end;