1. <legend id='c9xK3'><style id='c9xK3'><dir id='c9xK3'><q id='c9xK3'></q></dir></style></legend>
      <bdo id='c9xK3'></bdo><ul id='c9xK3'></ul>

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

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

      VARCHAR2(10 CHAR) 和 NVARCHAR2(10) 的区别

      时间:2023-09-18
    2. <legend id='IpUJV'><style id='IpUJV'><dir id='IpUJV'><q id='IpUJV'></q></dir></style></legend>

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

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

            • <bdo id='IpUJV'></bdo><ul id='IpUJV'></ul>

                <tbody id='IpUJV'></tbody>

                本文介绍了VARCHAR2(10 CHAR) 和 NVARCHAR2(10) 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我已经使用默认设置安装了 Oracle 数据库 10g 快捷版(通用):

                I've installed Oracle Database 10g Express Edition (Universal) with the default settings:

                SELECT * FROM NLS_DATABASE_PARAMETERS;
                

                NLS_CHARACTERSET               AL32UTF8                                 
                NLS_NCHAR_CHARACTERSET         AL16UTF16                                
                

                鉴于 CHARNCHAR 数据类型似乎都接受多字节字符串,这两个列定义之间的确切区别是什么?

                Given that both CHAR and NCHAR data types seem to accept multi-byte strings, what is the exact difference between these two column definitions?

                VARCHAR2(10 CHAR)
                NVARCHAR2(10)
                

                推荐答案

                NVARCHAR2 数据类型是由 Oracle 为数据库引入的,这些数据库希望对某些列使用 Unicode,同时为数据库的其余部分(使用 VARCHAR2)保留另一个字符集.NVARCHAR2 是仅限 Unicode 的数据类型.

                The NVARCHAR2 datatype was introduced by Oracle for databases that want to use Unicode for some columns while keeping another character set for the rest of the database (which uses VARCHAR2). The NVARCHAR2 is a Unicode-only datatype.

                您可能想要使用 NVARCHAR2 的一个原因可能是您的数据库使用非 Unicode 字符集,并且您仍然希望能够在不更改主要字符集的情况下为某些列存储 Unicode 数据.另一个原因可能是您想要使用两个 Unicode 字符集(AL32UTF8 用于主要来自西欧的数据,AL16UTF16 用于主要来自亚洲的数据),因为不同的字符集不会同样有效地存储相同的数据.

                One reason you may want to use NVARCHAR2 might be that your DB uses a non-Unicode character set and you still want to be able to store Unicode data for some columns without changing the primary character set. Another reason might be that you want to use two Unicode character set (AL32UTF8 for data that comes mostly from western Europe, AL16UTF16 for data that comes mostly from Asia for example) because different character sets won't store the same data equally efficiently.

                示例中的两列(Unicode VARCHAR2(10 CHAR)NVARCHAR2(10))都能够存储相同的数据,但是字节存储将是不同的.某些字符串可能更有效地存储在其中一个中.

                Both columns in your example (Unicode VARCHAR2(10 CHAR) and NVARCHAR2(10)) would be able to store the same data, however the byte storage will be different. Some strings may be stored more efficiently in one or the other.

                另请注意,某些功能不适用于 NVARCHAR2,请参阅此 SO 问题:

                Note also that some features won't work with NVARCHAR2, see this SO question:

                • Oracle Text 将无法工作与 NVARCHAR2.还有什么可能不可用?

                这篇关于VARCHAR2(10 CHAR) 和 NVARCHAR2(10) 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Oracle 中的视图是什么? 下一篇:Oracle 中更快的替代 SELECT COUNT(*) FROM sometable

                相关文章

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

                  <legend id='qY451'><style id='qY451'><dir id='qY451'><q id='qY451'></q></dir></style></legend>

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