Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PLSQL function
Try that
function calc(e in string ) return number is
r number;
begin
execute immediate
'begin :n:='||e||'; end;'
using r;
return r;
end;
/
Jon wrote:
> Hi,
>
> I like to know if it is posible to create a new function so that I could
> pass to it some numeric variables and on the other hand a string variable
> that contains a formula doing some calculations with the numeric variables I
> have also passed to the function. The contect of the string variable could
> look like this "+ cost - vat + net_change". So the question is if it could
> be posible, using PLSQL, to evalute the content of the variable with the
> formula and give me back the result of apliying the formula to the numeric
> values.
>
> Thanks for you help
>
>
>
Received on Wed Nov 28 2001 - 06:51:34 CST