Home » SQL & PL/SQL » SQL & PL/SQL » Using pl/sql Boolean datatype in ' where' clause of SQL select stmt
Using pl/sql Boolean datatype in ' where' clause of SQL select stmt [message #19317] Mon, 11 March 2002 20:13 Go to next message
Krish
Messages: 13
Registered: November 2001
Junior Member
I have a pl/sql function that returns a boolean value, how can I use
it directly in a select statement?

I can easily do this if the function returns a number value , e.g.

select * from my_table where my_package.function('abc') = 1;

But I can't figure out how to do this if the function return a boolean.
Any idea other than creating another function?
Re: Using pl/sql Boolean datatype in ' where' clause of SQL select stmt [message #19324 is a reply to message #19317] Tue, 12 March 2002 00:50 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
Boolean is only a PLSQL type. Binding to Boolean is not supported in any of the programmatic interfaces.

u have one option

fun1(x in boolean)
begin
if x then
return 1;
else
return 0;
end if;
end;
/

then u can say fun1(orginal_function(...))=1
Re: Using pl/sql Boolean datatype in ' where' clause of SQL select stmt [message #19347 is a reply to message #19317] Tue, 12 March 2002 18:42 Go to previous message
Krish
Messages: 13
Registered: November 2001
Junior Member
I'd like to use it in a SQL statement called from JDBC. I would like to avoid building any additional PL/SQL function into the DB schema.

Any pointers to this will be appreciated.
Thanx in advance.
Krish
Previous Topic: Re: True or False data type
Next Topic: eliminating rows when more than one rows has been returned
Goto Forum:
  


Current Time: Thu Apr 18 16:33:19 CDT 2024