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 -> Evaluation of Logical expression

Evaluation of Logical expression

From: Богомол Александр Анатольевич <bogomol_at_investbank.ru>
Date: Wed, 11 Apr 2007 17:28:01 +0300
Message-ID: <4703C546C994704E953AD8C47CA12CF751CCB3@ns.investbank.ru>


Replace 'C' logic characters '&&', '||' with 'AND' ,'OR' Then use 'execute immediate' statement.
Example:

C_logical_expression:= '(1>0) && (2>6)'
logical_expression:=
replace(replace(C_logical_expression,'&&','AND'),'&&','OR')

execute immediate

   'select nvl(max(1),0)

         from dual where
    '|| logical_expression
   into tmpn ;

if tmpn = 1 then
  successful!!!!
end if;

Alexander

-----Original Message-----
From: Sadashiva [mailto:a_at_b.c]
Posted At: Wednesday, April 11, 2007 3:13 PM Posted To: server
Conversation: Evaluation of Logical expression Subject: Evaluation of Logical expression

Hello,

I need to evaluate a logical expression (for e.g..: '(1>0) && (2>6)' ) stored as varchar in one of my tables. The logical expression is of standard
'C' language syntax.
Is there any standard function available in Oracle? Has anyone implemented any such logic?

Thanks,
Sadashiva Received on Wed Apr 11 2007 - 09:28:01 CDT

Original text of this message

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