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!

Function that returns boolean, used in WHERE clause of the SELECT

527448Feb 12 2009 — edited Feb 12 2009
I have the following function below:

create function IS_VALID
(
departure in date,
begin_date in date
) return boolean is
begin

return (departure >= begin_date);

end IS_VALID;

/* Structure of the table in which the function is used to select

create table data_validate (departure date);

insert into data_validate values (add_months(sysdate, 2));

*/

When I use the function in the code of a package, I receive the error: ORA-00920: invalid relational operator:

select *
from data_validate d
where IS_VALID_SALE(d.departure, sysdate);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2009
Added on Feb 12 2009
5 comments
4,551 views