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

StackOverflow https://stackoverflow.com/questions/23383490

  •  12-07-2023
  •  | 
  •  

質問

I have this trigger

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;

But this is throwing

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

I am not getting what is wrong in this kindly help

役に立ちましたか?

解決

Use keyword elsif instead of elseif

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top