Reputation: 4727
I have defined a logic where I want to use %
percentage as a calculation but its giving me error while using.
Below is the logic.
ELSIF V_ANCHOR_NONANCHOR = 'Anchor'
THEN
v_STD_REVISED_AMT := (V_STANDRD_AMT - v_OD_Discount) - ((V_STANDRD_AMT - v_OD_Discount * 10%));
and the error is
Error(103,94): PLS-00103: Encountered the symbol "%" when expecting one of the following: ) , * & = - + < / > at in is mod remainder not rem => <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec as between || member submultiset The symbol "%" was ignored.
Please suggest how to use it.
update
v_STD_REVISED_AMT := (V_STANDRD_AMT - v_OD_Discount) - ((V_STANDRD_AMT - v_OD_Discount * 0.1), (V_STANDRD_AMT - v_OD_Discount));
giving error as
Error(108,22): PLS-00412: list of values not allowed as argument to this function or procedure
Upvotes: 0
Views: 34
Reputation: 35920
I think you just want the multiplication by 0.1
which is 10/100
means 10%
as follows:
(V_STANDRD_AMT - (v_OD_Discount * 0.1))
-- Update
The entire solution should be as follows:
v_STD_REVISED_AMT := (V_STANDRD_AMT - v_OD_Discount)
- CASE WHEN V_ANCHOR_NONANCHOR = 'Anchor'
OR (M2_DATE_COL_VARIABLE < DATE '2019-03-31'
AND M2_DATE_COL_VARIABLE > DATE '2016-07-13')
THEN (V_STANDRD_AMT - v_OD_Discount * 10%)
ELSE 0
END;
Upvotes: 3