将接受大写和小写的字母数字约束

时间:2014-04-30 15:39:16

标签: sql oracle

如何让下面的代码接受小写和大写字母数字?

CONSTRAINT PART_PartNumber_CC CHECK (UPPER (PartNumber) BETWEEN 'AA00' AND 'ZZ99'),

感谢。

1 个答案:

答案 0 :(得分:1)

试试这个:

       CONSTRAINT PART_PartNumber_CC CHECK (REGEXP_LIKE (PartNumber, '^[[:alnum:]]+$'))