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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Really nice puzzle,but interested

Re: Really nice puzzle,but interested

From: Phung Hoang-Vu <hoang-vu_at_freesurf.ch>
Date: Mon, 20 Dec 1999 10:58:05 +0100
Message-ID: <385DFDAD.9B2AFEE8@freesurf.ch>


Well, you can always use function to_number to convert a string to a number.
To compute the formula you may use dynamic sql. See package dbms_sql for example.

Violin wrote:
>
> Hello all,
>
> I have a application system with many formulas.
> For user friendly,all of the formulas are defined by application user.
> Formulas are updated frequently but variables are constant.
> like this :
> Now Formula1 = ( A + B ) / C ,
> BUT maybe next month it becomes ( A + (B * 1.1) ) / ( C + 1)
> Anyway,Formula1 always need 3 variables : A ,B and C
> But expression is often changed.
> So I create a table to store all the formula:
> Table Name : TEMP
> Column : F_Name varchar2(50) , F_Expre varchar2(200) , Modified Date
>
> F_Name F_Expre modified
> -----------------------------------------------------------------------------
> Formula1 ( A + B ) / C 1999-12-03
> Formula2 ( A + B + C ) * ( D + 0.5 ) 1999-11-15
>
> But when I coding stored procedure,
> ex. create procedure compute_formula1 (A in number,B in number,C in number)
> as ... begin ..... end;
>
> I don't know how to compute the formulas,cause they are VARCHAR.
> If you know how to solve the problem,please tell me.
> I'll very appreciate it.
>
> Best Regards.
>
> Violin.
> violin.hsiao_at_mail.pouchen.com.tw
Received on Mon Dec 20 1999 - 03:58:05 CST

Original text of this message

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