Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Alpha Numeric Constraints

659033Sep 10 2008 — edited Oct 26 2008
Hi
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2008
Added on Sep 10 2008
26 comments
711 views