gpt4 book ai didi

database - 我可以对同一 namespace 中的不同对象使用所有带引号和不带引号的 UPPER_CASE 标识符吗?

转载 作者:搜寻专家 更新时间:2023-10-30 22:26:41 24 4
gpt4 key购买 nike

来自 Oracle doc第 9 个圆点:

Nonquoted identifiers are not case sensitive.Oracle interprets them as uppercase.Quoted identifiers are case sensitive.- part 1 -By enclosing names in double quotation marks,you can give the following names to differentobjects in the same namespace:employees"employees""Employees""EMPLOYEES"- part 2 -Note that Oracle interprets the following names the same,so they cannot be used for different objects in the same namespace:employeesEMPLOYEES"EMPLOYEES"

如果我可以将 employees"EMPLOYEES" 给同一命名空间中的不同对象(来自第 1 部分),那么为什么第 2 部分说我不能使用 employees"EMPLOYEES" 用于同一命名空间中的不同对象?

这不是自相矛盾吗?还是我理解错了?

最佳答案

如果您使用名称 employees,不带引号,那么 Oracle 会将其视为全部大写。事实上,employees,不带引号,任何大写字母/小写字母组合都将被视为 EMPLOYEES。因此,如果您还添加 "EMPLOYEES",那么您只会添加相同的标识符。

为了更直观的解释,请考虑以下 map :

input       | identifier
employees | EMPLOYEES
EMPLOYEES | EMPLOYEES
"EMPLOYEES" | EMPLOYEES
eMploYEeS | EMPLOYEES
"employees" | employees

我建议不要为需要用双引号转义的表、列等使用名称。除了区分大小写问题,您还应该避免使用保留的 SQL 关键字。

关于database - 我可以对同一 namespace 中的不同对象使用所有带引号和不带引号的 UPPER_CASE 标识符吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50404285/

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