Skip to Main Content

SQL & PL/SQL

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!

Conditional where clause in Oracle SQL query is not working

User_MB220Nov 5 2021

Hello, I am trying to do a select with this condition but it is not working.
LocalDateTime endDate = null;
Table POST
ID NUMBER
DATE_END TIMESTAMP(6)
select p.id from post p where (:endDate is null or p.date_end < :endDate);
but when endDate is null I got the error ORA-00932 inconsistent datatypes expected TIMESTAMP got NUMBER.
Please help, thanks!

This post has been answered by Warren Tolentino on Nov 5 2021
Jump to Answer
Comments
Post Details
Added on Nov 5 2021
5 comments
1,369 views