Implementing: An employee email address should use the company domain. That is, the
email address should end with ‘abcco.com’.
alter table employee
add constraint emp_email_check check (co_email in ('%abcco.com'));
but I get this error
ORA-02293: cannot validate (ITAM.EMP_EMAIL_CHECK) - check constraint violated
02293. 00000 - "cannot validate (%s.%s) - check constraint violated"
*Cause: an alter table operation tried to validate a check constraint to
populated table that had nocomplying values.
*Action: Obvious
>Solution :
The IN() predicate tests for exact string matches only. It does not support wildcards.
You should use
check (co_email like '%abcco.com')
Or alternatively:
check (left(co_email, 9) = 'abcco.com')