Tuesday, 27 August 2013

how to use 3 variables in PL/SQL function

how to use 3 variables in PL/SQL function

I try to use 3 local variable in a PL/SQL fuction, but when a run log
shows that 2 are invalid
Following is the code:
create or replace function valor_parcela(p_num_venda number, p_juros number)
return number is
tmp_valor_parcela number(7,2);
f_num_parcelas number(7,2);
f_valor number(7,2);
begin
Select num_parcelas
into :f_num_parcela
from VENDS
where numero=p_num_venda;
Select valor_total
into :f_valor
from VENDS
where numero=p_num_venda;
tmp_valor_parcela := (f_valor/f_num_parcela)*p_juros;
return (tmp_valor_parcela);
end;
/

No comments:

Post a Comment