Sv: Calculating Boolean

From: Jan Hansen <jan_at_IHATESPAMbrandsoft.dk>
Date: 2000/05/30
Message-ID: <bvKY4.44$Bh5.1364_at_news.get2net.dk>#1/1


Replace 'true' with (1=1) and 'false' with (1=2). Then use DBMS_SQL to evaluate 'select count(*) from dual where '||my_expr It will return 0 if the expression is false, otherwise it will return 1.

----Jan

> I've used DBMS_SQL to evaluate expressions that can return a
> value in SQL ('SELECT ' || my_expr || ' FROM dual').
>
> But Booleans are not a SQL datatype (can't do 'SELECT TRUE from
> dual'), which poses a problem. I hate to suggest this (because
> it's awkward and pokey), but perhaps you could use DBMS_SQL to
> create a temporary packaged function that analyzes your expr and
> returns a numeric (say, 0 for False, 1 for true). You could
> then use DBMS_SQL to query DUAL and return an integer value from
> your temporary function.
Received on Tue May 30 2000 - 00:00:00 CEST

Original text of this message