Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-00920 when using function returning boolean...
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