PL/SQL error PLS-00103
654774Sep 19 2008 — edited Sep 25 2008Hi Everyone,
This is a piece of PL/SQL that i have been working on. It is designed to update consignment figures by a percentage. the user will define wether the change is to be a plus or a minus.
BEGIN
IF :p6_maths=- then
update concount_forecast_data_copy
set MANUAL_ENTRY_CONS=MANUAL_ENTRY_CONS - (MANUAL_ENTRY_CONS/100)*:p2_percent, CITEDI_CONS=CITEDI_CONS - (CITEDI_CONS/100)*:p2_percent where country_name=:p2_country and week_no =:p2_week_no and year =:p2_year;
ELSE
update concount_forecast_data_copy
set MANUAL_ENTRY_CONS=MANUAL_ENTRY_CONS - (MANUAL_ENTRY_CONS/100)*:p2_percent, CITEDI_CONS=CITEDI_CONS - (CITEDI_CONS/100)*:p2_percent where country_name=:p2_country and week_no =:p2_week_no and year =:p2_year;
ENDIF;
END;
However it does not compile. The error i get is:
ORA-06550: line 2, column 17: PLS-00103: Encountered the symbol "THEN" when expecting one of the following: ( - + case mod new null avg count current max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe
1. BEGIN
2. if :p6_maths=- then
3. update concount_forecast_data_copy
4. set MANUAL_ENTRY_CONS=MANUAL_ENTRY_CONS - (MANUAL_ENTRY_CONS/100)*:p2_percent, CITEDI_CONS=CITEDI_CONS - (CITEDI_CONS/100)*:p2_percent where country_name=:p2_country and week_no =:p2_week_no and year =:p2_year;
I am not that experienced in PL/SQL and any help as to where i am going wrong would be appritiated :)
-N.S.N.O.