Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail
From: Maxim Demenko <mdemenko@gmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: ORA-00920 when using function returning boolean...
Date: Fri, 09 Sep 2005 20:01:55 +0200
Organization: T-Online
Lines: 31
Message-ID: <dfsil3$qcu$03$1@news.t-online.com>
References: <dfsfra$65t$1@nntp.fujitsu-siemens.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.t-online.com 1126288867 03 27038 Cvr-JUarbB2Kr75 050909 18:01:07
X-Complaints-To: usenet-abuse@t-online.de
X-ID: bRS4QsZBYevJpSh5FgXSFOkMSgbfqC-gzysEr0L-aFXRL7iHfwejEx
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: de-DE, de, en-us, en
In-Reply-To: <dfsfra$65t$1@nntp.fujitsu-siemens.com>
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:251192

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
