触发错误(14,1): PLS-00103:预期出现以下情况之一时遇到符号"THEN":= 。( % ;



我有这个触发

create or replace
trigger trg_cust
after insert or update on nbty_customer
referencing old as old new as new
for each row
declare
sal_diff number;
begin
if(:new.cust_sal>:old.cust_sal)
then
update nbty_cache_cust set cust_nbty_sal=:new.cust_sal where cust_nbty_id=:old.cust_id;
elseif(:new.cust_sal<:old.cust_sal)
then
update nbty_cache_cust set cust_nbty_sal=:old.cust_sal+:new.cust_sal where cust_nbty_id=:old.cust_id;
end if;
end;

但这是抛出

Error(14,1): PLS-00103: Encountered the symbol "THEN" when expecting one of the following:     := . ( % ; 

我不明白这里面有什么问题,请帮助

使用关键字elsif而不是elseif

相关内容

最新更新