0

Add a check constraint for the column, ONLY insert the values that didn't have any special characters except comma, space, full-stop and number in them?

For example allows like: Group Co.,Ltd

Should not allow ¿Abc is important

P Nayak
  • 39
  • 7
  • You can use regular expressions in check constraint. https://stackoverflow.com/questions/7621568/oracle-11g-check-constraint-with-regex – Nitish Jul 28 '17 at 11:06
  • Possible duplicate of [Oracle 11g - Check constraint with RegEx](https://stackoverflow.com/questions/7621568/oracle-11g-check-constraint-with-regex) – Nitish Jul 28 '17 at 11:08

1 Answers1

1

You can try the below example-

ALTER TABLE EMP ADD ( CONSTRAINT CC_NAME CHECK (TRIM(TRANSLATE(UPPER(ename),' ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_,.',' ')) is null));
Himanshujaggi
  • 391
  • 1
  • 9