<tfoot id='1qyU4'></tfoot>

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

      <small id='1qyU4'></small><noframes id='1qyU4'>

      <i id='1qyU4'><tr id='1qyU4'><dt id='1qyU4'><q id='1qyU4'><span id='1qyU4'><b id='1qyU4'><form id='1qyU4'><ins id='1qyU4'></ins><ul id='1qyU4'></ul><sub id='1qyU4'></sub></form><legend id='1qyU4'></legend><bdo id='1qyU4'><pre id='1qyU4'><center id='1qyU4'></center></pre></bdo></b><th id='1qyU4'></th></span></q></dt></tr></i><div id='1qyU4'><tfoot id='1qyU4'></tfoot><dl id='1qyU4'><fieldset id='1qyU4'></fieldset></dl></div>
    2. 小数(s,p)还是数字(s,p)?

      decimal(s,p) or number(s,p)?(小数(s,p)还是数字(s,p)?)

      <tfoot id='Gvn6z'></tfoot>

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

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

                <legend id='Gvn6z'><style id='Gvn6z'><dir id='Gvn6z'><q id='Gvn6z'></q></dir></style></legend>
                本文介绍了小数(s,p)还是数字(s,p)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                最近在做db2 -> oracle迁移项目时,遇到了这种情况.开发人员无意中使用小数(s,p)列创建了新的表结构.我不记得 Oracle 支持这个,但后来一些挖掘表明它是一个 ANSI 数据类型,因此被 oracle 支持.

                recently, while working on a db2 -> oracle migration project, we came across this situation. the developers were inadvertently creating new table structures using decimal(s,p) columns. I didn't remember Oracle supporting this, but then some digging showed that its a ANSI data type therefore supported by oracle.

                然而,我的问题仍然存在 -

                However, question for me remained -

                1. 内部如何处理这些数据?
                2. 使用 ANSI 类型而不是 Oracle 的内置类型是否有成本?
                3. 如果目标类型是Oracle内置类型,数据迁移过程中会不会有影响?

                推荐答案

                在 Oracle 中,它们是相同的:

                In Oracle, they are the same:

                创建表和簇的SQL语句也可以使用ANSI数据IBM 产品 SQL/DS 和 DB2 中的类型和数据类型.甲骨文识别与 Oracle 不同的 ANSI 或 IBM 数据类型名称数据库数据类型名称.它将数据类型转换为等效的Oracle 数据类型,将 Oracle 数据类型记录为列数据类型,以Oracle数据类型存储列数据基于下表中显示的转换.

                SQL statements that create tables and clusters can also use ANSI data types and data types from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM data type name that differs from the Oracle Database data type name. It converts the data type to the equivalent Oracle data type, records the Oracle data type as the name of the column data type, and stores the column data in the Oracle data type based on the conversions shown in the tables that follow.

                此引用下方的表格显示 DECIMAL(p,s) 在内部被视为 NUMBER(p,s):

                The table below this quote shows that DECIMAL(p,s) is treated internally as a NUMBER(p,s):

                SQL> create table t (a decimal(*,5), b number (*, 5));
                
                Table created
                
                SQL> desc t;
                Name Type        Nullable Default Comments 
                ---- ----------- -------- ------- -------- 
                A    NUMBER(*,5) Y                         
                B    NUMBER(*,5) Y  
                

                但是,DECIMAL 的比例默认为 0,这意味着 DECIMAL(*) 被视为 NUMBER(*, 0), 即 INTEGER:

                However, the scale defaults to 0 for DECIMAL, which means that DECIMAL(*) is treated as NUMBER(*, 0), i.e. INTEGER:

                SQL> create table t (a decimal, b number, c decimal (5), d decimal (5));
                
                Table created
                
                SQL> desc t;
                Name Type      Nullable Default Comments 
                ---- --------- -------- ------- -------- 
                A    INTEGER   Y                         
                B    NUMBER    Y                         
                C    NUMBER(5) Y                         
                D    NUMBER(5) Y   
                

                这篇关于小数(s,p)还是数字(s,p)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Using Alias In When Portion of a Case Statement in Oracle SQL(在 Oracle SQL 中 Case 语句的 When 部分中使用别名)
                Why doesn#39;t Oracle SQL allow us to use column aliases in GROUP BY clauses?(为什么 Oracle SQL 不允许我们在 GROUP BY 子句中使用列别名?)
                ORA-00972 identifier is too long alias column name(ORA-00972 标识符太长别名列名)
                Using an Alias in a WHERE clause(在 WHERE 子句中使用别名)
                How to create a user in Oracle 11g and grant permissions(如何在 Oracle 11g 中创建用户并授予权限)
                Can we connect a 32 bit Oracle server from a 64 bit client and vice a versa? (我们可以从 64 位客户端连接 32 位 Oracle 服务器,反之亦然吗?)
                  • <bdo id='Enbdj'></bdo><ul id='Enbdj'></ul>

                      <tbody id='Enbdj'></tbody>

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

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

                        <tfoot id='Enbdj'></tfoot>