phone-number check in constraint
If you need to verify phone number or other fields, and you want to ensure that not all characters can be used, the best is to use a check-constraint. The following constraint is simple, and fast 100 times faster than using a pl/sql-function (tested with 2mio records) because it is used directly on the table and there is no switching between the sql and pl/sql-engine.
alter table customer add constraint ck_phone_numeric check ((RPAD(TRANSLATE(phoneno,'0123456789+-X','XXXXXXXXXXXXa'),20,'X')='XXXXXXXXXXXXXXXXXXXX'));
You have to replace the length of the column (in this case 20) to the length of your column and of course the table name...



