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: ORA-00920 when using function returning boolean...

Re: ORA-00920 when using function returning boolean...

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Fri, 09 Sep 2005 20:01:55 +0200
Message-ID: <dfsil3$qcu$03$1@news.t-online.com>


Volker Hetzer schrieb:
> Hi!
> I'm trying to find out which sessions, out of a set, are still alive:
> select SessionId
> from (select SessionId from CVC_EDDY1 UNION select SessionId from
> CVC_EDDY2)
> where dbms_session.is_session_alive(SessionId);
>
> Unfortunately oracle then tells me that I use an invalid relational
> operator.
> I've tried ='TRUE' and =(1=1) but to no avail.
>
> Can anybody tell me what I'm doing wrong?
>
> Lots of Greetings and Thanks!
> Volker

Because boolean is not valid datatype in SQL, you need to write a wrapper function which converts TRUE/FALSE in whatever is valid ( i.e. 0/1 , Y/N etc.) or use the available SYS.DIUTIL.BOOL_TO_INT.

select SessionId

      from (select SessionId from CVC_EDDY1 UNION select SessionId from   CVC_EDDY2)
      where
SYS.DIUTIL.BOOL_TO_INT(dbms_session.is_session_alive(SessionId)) = 1;

Best regards

Maxim Received on Fri Sep 09 2005 - 13:01:55 CDT

Original text of this message

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