• <i id='uJOfh'><tr id='uJOfh'><dt id='uJOfh'><q id='uJOfh'><span id='uJOfh'><b id='uJOfh'><form id='uJOfh'><ins id='uJOfh'></ins><ul id='uJOfh'></ul><sub id='uJOfh'></sub></form><legend id='uJOfh'></legend><bdo id='uJOfh'><pre id='uJOfh'><center id='uJOfh'></center></pre></bdo></b><th id='uJOfh'></th></span></q></dt></tr></i><div id='uJOfh'><tfoot id='uJOfh'></tfoot><dl id='uJOfh'><fieldset id='uJOfh'></fieldset></dl></div>
    • <bdo id='uJOfh'></bdo><ul id='uJOfh'></ul>

    1. <small id='uJOfh'></small><noframes id='uJOfh'>

    2. <tfoot id='uJOfh'></tfoot>
        <legend id='uJOfh'><style id='uJOfh'><dir id='uJOfh'><q id='uJOfh'></q></dir></style></legend>
      1. 为什么 Oracle 9i 将空字符串视为 NULL?

        时间:2023-07-18
        1. <legend id='UUjPL'><style id='UUjPL'><dir id='UUjPL'><q id='UUjPL'></q></dir></style></legend><tfoot id='UUjPL'></tfoot>
          <i id='UUjPL'><tr id='UUjPL'><dt id='UUjPL'><q id='UUjPL'><span id='UUjPL'><b id='UUjPL'><form id='UUjPL'><ins id='UUjPL'></ins><ul id='UUjPL'></ul><sub id='UUjPL'></sub></form><legend id='UUjPL'></legend><bdo id='UUjPL'><pre id='UUjPL'><center id='UUjPL'></center></pre></bdo></b><th id='UUjPL'></th></span></q></dt></tr></i><div id='UUjPL'><tfoot id='UUjPL'></tfoot><dl id='UUjPL'><fieldset id='UUjPL'></fieldset></dl></div>
            <bdo id='UUjPL'></bdo><ul id='UUjPL'></ul>

              <small id='UUjPL'></small><noframes id='UUjPL'>

                    <tbody id='UUjPL'></tbody>
                  本文介绍了为什么 Oracle 9i 将空字符串视为 NULL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道它确实将""视为NULL,但这并不能告诉我为什么这是这种情况.据我了解 SQL 规范,' ' 与 NULL 不同——一个是有效数据,另一个表示没有相同的信息.

                  I know that it does consider '' as NULL, but that doesn't do much to tell me why this is the case. As I understand the SQL specifications, '' is not the same as NULL -- one is a valid datum, and the other is indicating the absence of that same information.

                  随意推测,但请指出是否是这种情况.如果 Oracle 的任何人可以对此发表评论,那就太好了!

                  Feel free to speculate, but please indicate if that's the case. If there's anyone from Oracle who can comment on it, that'd be fantastic!

                  推荐答案

                  我相信答案是 Oracle 非常非常古老.

                  I believe the answer is that Oracle is very, very old.

                  早在没有 SQL 标准之前,Oracle 的设计决定是 VARCHAR/VARCHAR2 列中的空字符串为 NULL 并且只有一种 NULL 含义(有关系理论家会区分从未被提示输入的数据、存在答案但用户不知道的数据、没有答案的数据等.所有其中构成某种意义上的NULL).

                  Back in the olden days before there was a SQL standard, Oracle made the design decision that empty strings in VARCHAR/VARCHAR2 columns were NULL and that there was only one sense of NULL (there are relational theorists that would differentiate between data that has never been prompted for, data where the answer exists but is not known by the user, data where there is no answer, etc. all of which constitute some sense of NULL).

                  当 SQL 标准出现并同意 NULL 和空字符串是不同的实体时,已经有 Oracle 用户的代码假定这两者是等效的.因此,Oracle 基本上只能选择破坏现有代码、违反 SQL 标准或引入某种初始化参数来改变潜在的大量查询的功能.违反 SQL 标准 (恕我直言) 是这三个选项中破坏性最小的.

                  By the time that the SQL standard came around and agreed that NULL and the empty string were distinct entities, there were already Oracle users that had code that assumed the two were equivalent. So Oracle was basically left with the options of breaking existing code, violating the SQL standard, or introducing some sort of initialization parameter that would change the functionality of potentially large number of queries. Violating the SQL standard (IMHO) was the least disruptive of these three options.

                  Oracle 保留了 VARCHAR 数据类型在未来版本中更改以符合 SQL 标准的可能性(这就是为什么每个人都在 Oracle 中使用 VARCHAR2该数据类型的行为保证在未来保持不变).

                  Oracle has left open the possibility that the VARCHAR data type would change in a future release to adhere to the SQL standard (which is why everyone uses VARCHAR2 in Oracle since that data type's behavior is guaranteed to remain the same going forward).

                  这篇关于为什么 Oracle 9i 将空字符串视为 NULL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在单个 SQL 查询中插入多行? 下一篇:仅在不存在的情况下插入一行

                  相关文章

                    <i id='owibJ'><tr id='owibJ'><dt id='owibJ'><q id='owibJ'><span id='owibJ'><b id='owibJ'><form id='owibJ'><ins id='owibJ'></ins><ul id='owibJ'></ul><sub id='owibJ'></sub></form><legend id='owibJ'></legend><bdo id='owibJ'><pre id='owibJ'><center id='owibJ'></center></pre></bdo></b><th id='owibJ'></th></span></q></dt></tr></i><div id='owibJ'><tfoot id='owibJ'></tfoot><dl id='owibJ'><fieldset id='owibJ'></fieldset></dl></div>

                    <small id='owibJ'></small><noframes id='owibJ'>

                      • <bdo id='owibJ'></bdo><ul id='owibJ'></ul>
                    1. <legend id='owibJ'><style id='owibJ'><dir id='owibJ'><q id='owibJ'></q></dir></style></legend>
                      <tfoot id='owibJ'></tfoot>