oracle 到 db2 数据类型:星号(数字精度)
我正在将现有的 Oracle SQL 查询转换为 DB2 - 我想知道 Oracle 构造是什么:
COLUMN1_ NUMBER(*,10)
...在 DB2 中意味着...
COLUMN1_
是表中的列名称。
I am converting an existing oracle SQL query to DB2 - I wanted to know what does the oracle construct:
COLUMN1_ NUMBER(*,10)
...would mean in DB2...
COLUMN1_
is the column name in the table.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我做了一些挖掘并发现了这个:
从这里:http://download.oracle。 com/docs/cd/B28359_01/server.111/b28318/datatype.htm#i22289
虽然我还没有找到它在 DB2 创建表查询方面的含义。
有任何输入吗?
I did some digging and found this:
from here: http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/datatype.htm#i22289
Though I have not found what it will mean interms of DB2 create table query.
Any inputs?
您可以将 NUMBER(x, y) 替换为 DECIMAL(x, y) 或启用 兼容性功能 并保持原样。
You can replace NUMBER(x, y) with DECIMAL(x, y) or enable compatibility features and leave it as is.
我不知道您可以使用星号,因此我创建了一个具有该列规范的表。在 Oracle 10.2 中它与
NUMBER(22, 10)
或DECIMAL(22, 10)
。第一个数字 (22) 是允许的最大有效数字位数。第二个数字 (10) 是小数点右侧的最大位数。
I didn't know you could use an asterisk so I created a table with that column specification. In Oracle 10.2 it's the same as
NUMBER(22, 10)
orDECIMAL(22, 10)
.The first number (22) is maximum number of significant digits allowed. The second number (10) is the maximum number of digits to the right of the decimal place.
从版本 9.7 开始,DB2 for Linux, UNIX, and Windows 现在支持多种 Oracle 函数、数据类型(NUMBER、VARCHAR2、包含时间戳的 DATE 等),并且还引入了 PL/SQL 兼容性。这些功能的目标是帮助加速和简化将应用程序从 Oracle 迁移到 DB2 的任务。 IBM 甚至提供了一个名为 MEET DB2 的兼容性分析工具,它将扫描 Oracle DDL(包括 PL/SQL 包)的摘录,以生成一份报告,突出显示可能需要进行一些手动调整才能在 DB2 中工作的区域。当 DB2_COMPATIBILITY_VECTOR 设置为 ORA 时,超过 90% 的原始 Oracle 代码按原样正常运行的情况并不少见。
Starting with release 9.7, DB2 for Linux, UNIX, and Windows now supports a wide variety of Oracle functions, data types (NUMBER, VARCHAR2, DATE that includes a timestamp, to name a few), and also introduces PL/SQL compatibility. The goal of these features is to help accelerate and simplify the task of migrating applications from Oracle to DB2. IBM even provides a compatibility analysis tool called MEET DB2 that will scan an extract of your Oracle DDL (including PL/SQL packages) to produce a report that highlights the areas that may require some manual adjustment to work in DB2. When the DB2_COMPATIBILITY_VECTOR is set to ORA, it is not uncommon for over 90% of the original Oracle code to function properly as-is.