Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PLSQL function

Re: PLSQL function

From: Mark Malakanov <markmal_no_spam_at_home.com>
Date: Wed, 28 Nov 2001 12:51:34 GMT
Message-ID: <3C04ED0C.208@home.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US