Bug: 使用SQL方式向Oracle数据库的表中添加一个为“number(N) default 1 not null”字段,ArcSDE For Oracle11g 会错误识别该字段的信息

文章编号 : 37558
软件: ArcSDE 9.3, 9.3.1, BETA 9.4
操作系统: N/A
已邀请:

EsriSupport

赞同来自:

错误信息:
使用SQL方式向Oracle11g中的某一个表或要素类中添加一个新的字段,其中设置了该字段的默认值和not null参数,ArcSDE和ArcGIS会错误的识别该字段类型,ArcSDE将该字段识别为SE_FLOAT64 (38,10),而不是SE_INT32 (10) SQL> alter table testdt add (NEWCOLUMN number(10) default 1 not null); alter table testdt add (NEWCOLUMN number(10) default 1 not null)
Table altered.
Describe the table: SQL> desc testdt Name Null? Type ----------------------------------------- -------- ---------------------------- OBJECTID NOT NULL NUMBER(38) NEWCOLUMN NOT NULL NUMBER(10)
SQL> $sdetable -o describe -u samoht -p nworb -i 5151 -t testdt
ArcSDE 9.3.1 for Oracle11g Build 1632 Thu Feb 26 12:05:37 2009 Attribute Administration Utility -----------------------------------------------------
Table testdt: Column name Attribute type Null? Length,DPs RowID Column? ------------------------------------------------------------------------------- OBJECTID SE_INT32 NOT NULL 10 SDE Set NEWCOLUMN SE_FLOAT64 NOT NULL 38,10
ArcGIS 将该字段显示为Double类型,而不是长整型
原因:
这是Oracle11g中提供的一个优化措施,可以查看Oracle支持网站:Bug 7489902: WRONG PRECISION DESCRIBING A SELECT OF AN ALTERED COLUMN

解决方法:
依照以下步骤更改表对象参数 1. SQL> alter table testdt add (NEWCOLUMN number(10) default 1);
Table altered. 2. SQL> alter table testdt modify (NEWCOLUMN number(10) not null);
Table altered. 3.Describe the table: SQL> desc testdt Name Null? Type ----------------------------------------- -------- ---------------------------- OBJECTID NOT NULL NUMBER(38) NEWCOLUMN NOT NULL NUMBER(10)
SQL> $sdetable -o describe -u samoht -p nworb -i 5151 -t testdt
ArcSDE 9.3.1 for Oracle11g Build 1632 Thu Feb 26 12:05:37 2009 Attribute Administration Utility -----------------------------------------------------
Table testdt: Column name Attribute type Null? Length,DPs RowID Column? ------------------------------------------------------------------------------- OBJECTID SE_INT32 NOT NULL 10 SDE Set NEWCOLUMN SE_INT32 NOT NULL 10
现在可以在ArcCatalog中预览该对象,即可以正确显示字段类型了


创建时间:2010-02-04
最近更新: 2010-02-18


原文链接
http://support.esrichina.com.c ... .html

要回复问题请先登录注册