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: Oracle eval() function?

Re: Oracle eval() function?

From: Barry Evans <barry_at_promaxis.com>
Date: 2000/03/28
Message-ID: <6W8E4.1241$9o.2510602@news.magma.ca>#1/1

You can just do a select from dual

select (5+2*(3+200)/2)
from dual

and just use SELECT INTO to get it into a variable

DECLARE
   sample_num number(10);
BEGIN
   SELECT (5+2*(3+200)/2) INTO sample_num FROM dual; END; Barry

<thycotic_at_my-deja.com> wrote in message news:8bogpp$q84$1_at_nnrp1.deja.com...
> Does anybody know how to get Oracle to evaluate a string
> as an expression in PL/SQL?
> Something similar to the eval functions of VB, JavaScript and Perl.
> e.g. eval("5+2*(3+200)/2")
> Not having to write a custom function would be preferable...
> TIA,
> J
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Mar 28 2000 - 00:00:00 CST

Original text of this message

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