
28-Jul-2006, 08:11 AM
|
 | Guest | | | | | | | | |
| Re: How do I get Access to display a UK telephone number?
torch_music wrote: Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/10166-how-do-i-get-access-display.html
> you should give some
> thought to validation of the data.
Here's some thoughts on the subject (I'm going to break my own rule and
use only 'ANSI mode' wildcard characters ):
CREATE TABLE Test9 (
contact_detail_type VARCHAR(9) DEFAULT 'Business' NOT NULL,
CONSTRAINT TelephoneContactDetails__contact_detail_type__valu es
CHECK (contact_detail_type IN ('Business', 'Home', 'Other')),
national_number VARCHAR(20) NOT NULL,
CONSTRAINT telephone_contact_detail_national_number__pattern
CHECK
(
national_number NOT LIKE '%[!0-9 -]%'
AND national_number LIKE '%[0-9]%'
), Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10166
CONSTRAINT telephone_contact_detail_national_number__spaces
CHECK
(
national_number NOT LIKE ' %'
AND national_number NOT LIKE '% '
AND national_number NOT LIKE '% %'
),
CONSTRAINT telephone_contact_detail_national_number__hyphens
CHECK
(
national_number NOT LIKE '-%'
AND national_number NOT LIKE '%-'
AND national_number NOT LIKE '%--%'
),
extension_number VARCHAR(6),
CONSTRAINT telephone_contact_detail_extension_number__pattern
CHECK (extension_number NOT LIKE '%[!0-9]%'),
country_number VARCHAR(3) DEFAULT '44' NOT NULL,
CONSTRAINT telephone_contact_detail_country_number__pattern
CHECK (country_number NOT LIKE '%[!0-9]%'),
CONSTRAINT telephone_contact_detail_country_number__UK_only
CHECK (country_number = '44')
);
Jamie.
-- |