Reputation: 45
I need a constraint where @ must be included in the email address. Any ideas? Using Oracle Live SQL if that helps.
Thank you in advance.
Upvotes: 1
Views: 38
Reputation: 1269633
You would use a check
constraint:
alter table t add constraint chk_t_email
check (email like '%@%');
Note: Full "format" validation of emails addresses is much more complicated -- and requires regular expressions. If you do some searching, you can probably find some already-built regular expressions for better validation.
Upvotes: 2