Thanks a million, I am going to try it and let you know how it works
out. I can see the result I am looking for.
Shakir
- "Jamadagni, Rajendra" <Rajendra.Jamadagni_at_espn.com> wrote:
> TRy something like this ...
>
> CREATE OR REPLACE PACKAGE My_Dynamic_Stuff IS
> v_result NUMBER;
> --
> PROCEDURE eval_this (pi_string IN VARCHAR2);
> END My_Dynamic_Stuff;
> /
>
> CREATE OR REPLACE PACKAGE BODY My_Dynamic_Stuff IS
> --
> PROCEDURE eval_this (pi_string IN VARCHAR2) IS
> BEGIN
> RTRIM(pi_string,';') || '; end;';
> END eval_this;
> --
> END My_Dynamic_Stuff;
> /
>
>
> Here is a test ...
>
> SQL> get raj_test
> 1 declare
> 2 my_str varchar2(100);
> 3 begin
> 4 dbms_output.enable;
> 5 my_dynamic_stuff.eval_this('1 + 1 + 1 + 1');
> 6 dbms_output.put_line ('"1 + 1 + 1 + 1" evaluates to : ' ||
> to_char(my_dynamic_stuff.v_result));
> 7 --
> 8 my_dynamic_stuff.eval_this('1 + (2 - 3)/4 + 5 / 4 + (6 + 7) /
> ( 5 +
> 5 + 0)');
> 9 dbms_output.put_line ('"1 + (2 - 3)/4 + 5 / 4 + (6 + 7) / ( 5
> + 5 +
> 0)" evaluates to : ' || to_char(my_dynamic_stuff.v_result));
> 10* end;
>
> SQL> @raj_test
>
> "1 + 1 + 1 + 1" evaluates to : 4
> "1 + (2 - 3)/4 + 5 / 4 + (6 + 7) / ( 5 + 5 + 0)" evaluates to : 3.3
>
> PL/SQL procedure successfully completed.
>
> SQL>
>
> HTH some
> Raj
> ______________________________________________________
> Rajendra Jamadagni MIS, ESPN Inc.
> Rajendra dot Jamadagni at ESPN dot com
> Any opinion expressed here is personal and doesn't reflect that of
> ESPN Inc.
>
> QOTD: Any clod can have facts, but having an opinion is an art!
> >
*******************************************************************************1
>
> This e-mail message is confidential, intended only for the named
> recipient(s) above and may contain information that is privileged,
> attorney work product or exempt from disclosure under applicable law.
> If you have received this message in error, or are not the named
> recipient(s), please immediately notify ESPN at (860) 766-2000 and
> delete this e-mail message from your computer, Thank you.
>
>
*******************************************************************************1
>
Mohammed Shakir
CompuSoft, Inc.
11 Heather Way
East Brunswick, NJ 08816-2825
(732) 672-0464 (Cell)
(732) 257-6001 (Home)
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Mohammed Shakir
INET: mshakir08816_at_yahoo.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Wed Apr 03 2002 - 14:58:24 CST