function CF_OP_QTYFormula return Number
is
v_qty number(10);
begin
select sum(L_QTY)
into v_qty
from purchase_01
where MONTH_YEAR = :P_MONTH_YEAR -1;
return v_qty;
end;
First of all, I'm pretty sure that MONTH_YEAR =: P_MONTH_YEAR -1; is wrong syntax. The operator =: it's wrong. The right operator is :=.