I'm using Oracle 11g, and trying to create a table define constraints on the creation.
I was trying to add check constraint to validate some information (like e-mail address, phone number, etc...)
Is there something in Oracle 11g that would allow me to do something like this?
constraint CK_CONSTRAINT_NAME check (EMAIL like 'REGEX')
A check constraint follows the same syntax rules as conditions for a WHERE clause:
alter table foo add constraint check_email check (REGEXP_LIKE(email,'your_regex_goes_here','I'));
More details in the manual:
There are however some restrictions on what you can actually use in a check constraint: