Violate a check constraint
SQL> create table myTable(
2 col1 char(1)constraint check_col1 check (col1 in ('B','G','N'))
3 );
Table created.
SQL>
SQL> insert into myTable values ('B');
1 row created.
SQL> insert into myTable values ('C');
insert into myTable values ('C')
*
ERROR at line 1:
ORA-02290: check constraint (JAVA2S.CHECK_COL1)
violated
SQL> insert into myTable values ('C')
2
SQL>
SQL> drop table myTable;
Table dropped.
Related examples in the same category