andyskinner
MIS
Hya,
Have a huge PLSQL function that does a bunch of calculations. The function works fine when tested in a begin statement like so;
begin
-- Call the function
:result := something.fnc_calculate_cost(cicpiid => :cicpiid,
cdstart => :cdstart,
cdend => :cdend);
end;
However, when the function is used as part of a select statement (with the same input parameters) like so;
select fnc_calculate_cost(48438,to_date('14-06-2004','dd-mm-yyyy'),to_date('20-06-2004','dd-mm-yyyy')) as test
from dual
It consistently returns zero! I have no idea why this would happen, I would have expected it to work in both cases. Anyone got any ideas as to what could be going wrong?
Cheers,
Andy Skinner.
Have a huge PLSQL function that does a bunch of calculations. The function works fine when tested in a begin statement like so;
begin
-- Call the function
:result := something.fnc_calculate_cost(cicpiid => :cicpiid,
cdstart => :cdstart,
cdend => :cdend);
end;
However, when the function is used as part of a select statement (with the same input parameters) like so;
select fnc_calculate_cost(48438,to_date('14-06-2004','dd-mm-yyyy'),to_date('20-06-2004','dd-mm-yyyy')) as test
from dual
It consistently returns zero! I have no idea why this would happen, I would have expected it to work in both cases. Anyone got any ideas as to what could be going wrong?
Cheers,
Andy Skinner.