Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check constraint

Status
Not open for further replies.

mcvdmvs

Technical User
Sep 18, 2000
172
NL
I have a simple question. Can i check a field in a db with a regular expression?
CREATE TABLE "links" (
"id" int primary key index NOT NULL,
"naam" varchar(32) NOT NULL,
"omschrijving" text NOT NULL,
"url" varchar(128) NOT NULL CHECK (^([0-9a-z]([-\\.]?[0-9a-z])*\\.)+[a-z]{2,}:)[0-9]+)?(/[-/.=_&0-9a-z]*)?(\\?[-.=_&0-9a-z]*)?$),
"regioid" int,
"brancheid" int NOT NULL,
"hits" int DEFAULT 0,
"prioriteit" int UNIQUE
); mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
Btw the answer is yes, and the above works. mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top