Alpha Numeric Constraints
659033Sep 10 2008 — edited Oct 26 2008Hi
I am trying to add a table called DELIVERY and one of the fields (DeliveryID) has a constraint of "Either 1 letter & 1 digit, or just 1 letter".
Acceptable examples are: D1, A2, A, Z, X
Unacceptable examples are: AA, 22, 2A, 123.....
was using the below but it was not working....
CREATE TABLE Delivery
(DeliveryID VARCHAR2(2),
CONSTRAINT delivery_deliveryid_cc CHECK ((DeliveryID BETWEEN 'A' AND 'Z') OR (DeliveryID BETWEEN 'A0' AND 'Z9')));
Anyone have any suggestions?