create table a ( sdf char (32), Id char(40), primary key (sdf), check (Id like'([0-9]{15})|([0-9]{18})') ); insert into A values('23','532924199000310143');
Table created. SQL> insert into A values('23','53292419900031014a'); insert into A values('23','53292419900031014a') * ERROR at line 1: ORA-02290: check constraint (SYS.SYS_C00251603) violated
SQL> insert into A values('23','53292419900031a'); insert into A values('23','53292419900031a') * ERROR at line 1: ORA-02290: check constraint (SYS.SYS_C00251603) violated
SQL> insert into A values('23','532924199000310143'); 1 row created. SQL> insert into A values('22','532924199000310'); 1 row created. SQL> commit; Commit complete.