i want to accept only alphabetic value
Asked
Active
Viewed 113 times
1 Answers
0
Using constraint to accept only alphabetic values :
ALTER TABLE table_name ADD CONSTRAINT column_alpha_check
CHECK
(
Column_Name like '%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]%'
)
-
There may be problems with check constraint see http://stackoverflow.com/questions/34132644/sql-check-constraint-not-working-properly, http://stackoverflow.com/questions/2115497/check-constraint-in-mysql-is-not-working. I note that mariadb 10.2.1 supposedly does support check constraints. Don't know about mysql. – P.Salmon Feb 21 '17 at 10:06