For better or worse, the sort ordering defined by nls_sort is being used to evaluate the [a-z] regexp. If you insert a,b,c,A,B, and C into temp_table and sort it under each setting you'll get the following:
SQL> alter session set nls_sort=BINARY;
Session altered.
SQL> select val,
2 case when regexp_like (val, '[a-z]') then 'MATCH' else 'NO' end m
3 from temp_table order by val;
VAL M
------------------------- -------------------------
A NO
B NO
C NO
a MATCH
b MATCH
c MATCH
6 rows selected.
SQL> alter session set nls_sort=FRENCH;
Session altered.
SQL> select val,
2 case when regexp_like (val, '[a-z]') then 'MATCH' else 'NO' end m
3 from temp_table order by val;
VAL M
------------------------- -------------------------
A NO
a MATCH
B MATCH
b MATCH
C MATCH
c MATCH
6 rows selected.
Since the upper case letters are "interleaved" with the lower case letters in the French setting it evaluates to true in Oracle's implementation.
因篇幅问题不能全部显示,请点此查看更多更全内容