我有这个触发
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