Kør:
SELECT *
FROM NLS_SESSION_PARAMETERS
WHERE parameter IN ( 'NLS_COMP', 'NLS_SORT' );
Og se, hvilke NLS-sessionsparametre du bruger.
For eksempel:
ALTER SESSION SET NLS_COMP=BINARY;
ALTER SESSION SET NLS_SORT=BINARY;
SELECT regexp_count('OOO', '[a-z0-9]', 1, 'c' ) AS COUNT_AZ,
regexp_count('OOO', '[[:lower:][:digit:]]', 1, 'c' ) AS count_lower
FROM DUAL;
Udgange:
Men:
ALTER SESSION SET NLS_COMP=ANSI;
ALTER SESSION SET NLS_SORT=GERMAN_AI;
-- or ALTER SESSION SET NLS_SORT=GERMAN_CI;
-- or ALTER SESSION SET NLS_SORT=FRENCH_CI;
-- or many others
SELECT regexp_count('OOO', '[a-z0-9]', 1, 'c' ) AS COUNT_AZ,
regexp_count('OOO', '[[:lower:][:digit:]]', 1, 'c' ) AS count_lower
FROM DUAL;
Udgange:
For at rette dette kan du enten:
- Skift
NLS_SORT
sessionsparameter. - Eller (som nævnt af @AlexPoole) brug
[:lower:]
POSIX-tegnsæt i stedet fora-z
.
db<>fiddle her