How to handle relational operators for date comparison?

1.7k views Asked by At

Create table ISSUE ( Lib_Issue_Id Number(10), Book_No Number(6), Member_Id Number(5), Issue_Date Date, Return_date Date

    CONSTRAINT
        chk_issue_date
    CHECK
    (
        Issue_Date,
        ( TO_CHAR( Issue_Date, 'yyyy-mm-dd' ) <= TO_CHAR( SYSDATE(), 'yyyy-mm-dd' )
    )
) 

Error ORA-00920: invalid relational operator

  • same error with or without to_date and to_char
    • Same error when tried using alter table and add constraint
0

There are 0 answers