Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > create table foo > ( > the_column varchar(20) not null, > CONSTRAINT check_numbers CHECK (regexp_like(the_column, '^[67]+$')) > ); > > <pre> > ✓ > </pre> <!-- --> > insert into foo values ('54'); > > <pre> > ORA-02290: check constraint (FIDDLE_MZPECFQLXVKXVDSLXXEL.CHECK_NUMBERS) violated > </pre> <!-- --> > insert into foo values ('67776'); > > <pre> 1 rows affected > </pre> <!-- --> > select * > from foo; > > <pre> > | THE_COLUMN | > | :--------- | > | 67776 | > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=c7229678984cd47b957c783379c8a654)*
back to fiddle