Search notes:

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

In the following create table statement, the to_date of the check constraint does not have conversion format and it is not clear which format should be chosen.
Oracle won't create the table with such a constraint and throws ORA-02436: date or system variable wrongly specified in CHECK constraint.
create table tq84_ORA_02436 (
   dat   varchar2(10) not null check(to_date(dat) >= date '2020-01-01'),
   val   number(5,1)
);

Setting event 10149

If someone insists on creating the table, the event 10149 can be set:
alter session set events '10149 trace name context forever, level 1';

create table tq84_ORA_02436 (
   dat   varchar2(10) not null check(to_date(dat) >= date '2020-01-01'),
   val   number(5,1)
);
However, the following sequence throws ORA-01843: not a valid month
alter session set nls_date_format = 'dd/mm/yyyy';
insert into tq84_ORA_02436 values ('28/08/2021', 42);

See also

The date datatype
Check constraints
Other Oracle error messages

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206519, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-02436_date-or-system-variable-wrongly-specified-in-CHECK-constraint(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78