gpt4 book ai didi

oracle - 在哪里可以查询oracle数据库的大小写敏感度?

转载 作者:行者123 更新时间:2023-12-02 03:04:22 26 4
gpt4 key购买 nike

哪里可以查询oracle数据库当前的区分大小写设置?

我尝试查看v$databasenls_database_parameters,并查看系统包,但它们似乎都没有提供我需要的信息......

最佳答案

Oracle 10gR2中:

SELECT  *
FROM NLS_SESSION_PARAMETERS
WHERE parameter IN ('NLS_COMP', 'NLS_SORT')

SQL> ALTER SESSION SET NLS_COMP = 'LINGUISTIC'
2 /

Session altered
SQL> SELECT COUNT(*)
2 FROM dual
3 WHERE 'a' = 'A'
4 /

COUNT(*)
----------
1

SQL> ALTER SESSION SET NLS_COMP = 'BINARY'
2 /

Session altered
SQL> SELECT COUNT(*)
2 FROM dual
3 WHERE 'a' = 'A'
4 /

COUNT(*)
----------
0

来自documentation :

NLS_COMP specifies the collation behavior of the database session.

Values:

  • BINARY

    Normally, comparisons in the WHERE clause and in PL/SQL blocks is binary unless you specify the NLSSORT function.

  • LINGUISTIC

    Comparisons for all SQL operations in the WHERE clause and in PL/SQL blocks should use the linguistic sort specified in the NLS_SORT parameter. To improve the performance, you can also define a linguistic index on the column for which you want linguistic comparisons.

  • ANSI

    A setting of ANSI is for backwards compatibility; in general, you should set NLS_COMP to LINGUISTIC

关于oracle - 在哪里可以查询oracle数据库的大小写敏感度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1244804/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com