Skip to Main Content

Oracle Database Free

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid relational operator when using boolean expressions with logical conditions

Lukas EderApr 5 2023

I'm using: https://hub.docker.com/r/gvenzl/oracle-free

Trying out BOOLEAN types, I can see that this works:

with b (b) as (select true)
select not b
from b;

But this doesn't:

with b (b) as (select true)
select not coalesce(null, b)
from b;

It fails with:

SQL Error [920] [42000]: ORA-00920: invalid relational operator

Same with other expressions based on BOOLEAN columns:

with b (b) as (select true)
select not (case b when true then true else false end)
from b;

I'd say this is a bug or missing feature/implementation, given that I've never encountered any other implementation with such a limitation (e.g. PostgreSQL, and many others), nor does the SQL standard limit BOOLEAN expressions this way.

This post has been answered by Loïc Lefèvre-Oracle on Apr 5 2023
Jump to Answer
Comments
Post Details
Added on Apr 5 2023
5 comments
1,171 views