以下比较意味着什么?

时间:2022-11-18 16:55:24

Could any one explain why NOVALIDATE is written their and why alpha betwnn two ":" and "[]"

任何人都可以解释为什么NOVALIDATE写出他们为什么alpha打两个“:”和“[]”

ALTER TABLE CUSTOMERS
ADD CONSTRAINT cust_f_name
CHECK(REGEXP_LIKE(cust_first_name,'[[:alpha:]]'))NOVALIDATE ;

and what does

什么呢

REGEXP_LIKE(cust_first_name,'^[0-9]') 

and

REGEXP_LIKE(cust_first_name,'^A-Z')

means ? is that numbers not allowed?

意思?是不允许的数字?

1 个解决方案

#1


3  

These are regular expressions, used in Oracle as a table constraint.

这些是正则表达式,在Oracle中用作表约束。

  • [:alpha:] matches any character from the alpha POSIX class; that is, alphabetic characters (a-z and A-Z).
  • [:alpha:]匹配alpha POSIX类中的任何字符;也就是说,字母字符(a-z和A-Z)。
  • The ^, in the context of ^[0-9], means look from the beginning of the string. [0-9] is the class of numbers (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9)
  • 在^ [0-9]的上下文中,^表示从字符串的开头看。 [0-9]是数字类别(即0,1,2,3,4,5,6,7,8和9)
  • ^A-Z means negate the class A-Z; so it would match anything that didn't contain an upper case alphabetic character.
  • ^ A-Z表示否定A-Z类;所以它会匹配任何不包含大写字母字符的东西。

NOVALIDATE means that, once the constraint is added to the table CUSTOMERS, Oracle will not check that any current entries violate the constraint and only apply it to newly inserted records.

NOVALIDATE意味着,一旦约束被添加到表CUSTOMERS,Oracle将不会检查任何当前条目是否违反约束并仅将其应用于新插入的记录。

#1


3  

These are regular expressions, used in Oracle as a table constraint.

这些是正则表达式,在Oracle中用作表约束。

  • [:alpha:] matches any character from the alpha POSIX class; that is, alphabetic characters (a-z and A-Z).
  • [:alpha:]匹配alpha POSIX类中的任何字符;也就是说,字母字符(a-z和A-Z)。
  • The ^, in the context of ^[0-9], means look from the beginning of the string. [0-9] is the class of numbers (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9)
  • 在^ [0-9]的上下文中,^表示从字符串的开头看。 [0-9]是数字类别(即0,1,2,3,4,5,6,7,8和9)
  • ^A-Z means negate the class A-Z; so it would match anything that didn't contain an upper case alphabetic character.
  • ^ A-Z表示否定A-Z类;所以它会匹配任何不包含大写字母字符的东西。

NOVALIDATE means that, once the constraint is added to the table CUSTOMERS, Oracle will not check that any current entries violate the constraint and only apply it to newly inserted records.

NOVALIDATE意味着,一旦约束被添加到表CUSTOMERS,Oracle将不会检查任何当前条目是否违反约束并仅将其应用于新插入的记录。