Home » SQL & PL/SQL » SQL & PL/SQL » check date is later than current date.
check date is later than current date. [message #6908] Sun, 11 May 2003 02:48 Go to next message
jun
Messages: 7
Registered: May 2003
Junior Member
In the table storing credit card data, I hope to check that expiredate is at least 15 days later than current date. I have a check constraint

constraint ck_date check (expiredate > sysdate + 15)

in create table statment, but the error is:

ORA-02436: date or system variable wrongly specified in CHECK constraint

How can I use sysdate in check constraint?
Re: check date is later than current date. [message #6910 is a reply to message #6908] Sun, 11 May 2003 03:42 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You can't use SYSDATE in a check constraint. Use a trigger instead. A before insert/update row trigger can do the trick.

MHE
Previous Topic: Help needed
Next Topic: How do I loop within a select statement anspass in parameters?
Goto Forum:
  


Current Time: Wed Apr 24 14:43:31 CDT 2024