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: Andy <as.no.spam.stedat_at_gmx.net>
Date: Wed, 28 Nov 2001 12:46:39 GMT
Message-ID: <3c04dc70.22700741@by-news.bayer-ag.com>


On Wed, 28 Nov 2001 10:16:02 +0100, "Jon" <jzuazoa_at_nexo.es> 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
>
>

Yes. You can do this using dynamic sql. Passing the arguments to the procedure and dynamically building a sql string which returns the value you want. See dbms_sql package.

hth
Andy Received on Wed Nov 28 2001 - 06:46:39 CST

Original text of this message

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