SQLite Forum

Check Contraints
Login
Hi, I need to create a check constraint that only allows uppercase letters and numbers between 0 to 9 to be entered.

below is the schema.

CREATE TABLE Vehicle(
VIN TEXT NOT NULL,
odometer INTEGER NOT NULL,
PRIMARY KEY (VIN)
CHECK (VIN NOT LIKE '%[A-Z0-9]%')
);