0

我有一个简单的插入 SQL 脚本,它在直接在数据库上运行时执行。但是,当我对从 Web 逻辑数据源获得的数据库连接执行相同的查询时,它会抛出以下异常。

ORA-01438: 该列允许的值大于指定的精度

有任何想法吗?

这是我的表的 DDL 和 sql 查询。

DDL:

CREATE TABLE "TABLE_NAME" 
   ("N_PROP_ID" NUMBER(10,0) NOT NULL ENABLE, 
    "C_TYPE" VARCHAR2(1 BYTE) NOT NULL ENABLE,
    "N_PRO_IDENTIFIER" NUMBER(10,0) NOT NULL ENABLE,
    "BL_CONCAT_AVAILABLE" NUMBER(1,0),
    "BL_IS_SELECTABLE" NUMBER(1,0), 
    "C_LABEL" VARCHAR2(30 BYTE), 
    "C_INSTANCE1" VARCHAR2(32 BYTE), 
    "C_INSTANCE2" VARCHAR2(32 BYTE), 
    "N_VERSION" NUMBER(2,0), 
    "C_INSTANCE3" VARCHAR2(32 BYTE), 
    "VERSION1" NUMBER(2,0), 
    "VERSION2" NUMBER(2,0), 
    "C_DF_IDENTIFIER" VARCHAR2(20 BYTE), 
    "B_MSL" RAW(1), 
    "PORT" NUMBER(4,0), 
     CONSTRAINT "PK_PROPERTIES" PRIMARY KEY ("N_PROP_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL KEEP FLASH_CACHE 
  DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "INDX_REP_RCA"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL KEEP FLASH_CACHE 
  DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "DATA_REP_RCA" 
  CACHE ;

   COMMENT ON TABLE "TABLE_NAME"  IS 'Table which describes all security properties.';

  CREATE INDEX "FK_PROPERTIES_TO_PROFILE" ON "TABLE_NAME" ("N_PRO_IDENTIFIER")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL KEEP FLASH_CACHE 
  DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "INDX_REP_RCA" ;
  CREATE UNIQUE INDEX "PK_PROPERTIES" ON "TABLE_NAME" ("N_PROP_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL KEEP FLASH_CACHE 
  DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "INDX_REP_RCA" ;

SQL查询:

insert into TABLE_NAME (N_PRO_IDENTIFIER, C_LABEL, C_INSTANCE3, 
    VERSION1, VERSION2, 
    C_INSTANCE2, C_INSTANCE1, 
    PORT, B_MSL, C_TYPE, N_PROP_ID) 
values 
    (50690, 'UICC applet instance', 'A000000018210008', 
     1, 0,
     'A00000001803090000000000B00000', 'A00000001803090000000000B00000', 
     101, null, 'I', 27548);

先感谢您。

4

1 回答 1

0

请使用如下查询:

insert into TABLE_NAME (N_PRO_IDENTIFIER, C_LABEL, C_INSTANCE3, 
    VERSION1, VERSION2, 
    C_INSTANCE2, C_INSTANCE1, 
    PORT, B_MSL, C_TYPE, N_PROP_ID) 
values 
    (50690, 'UICC applet instance', 'A000000018210008', 
     '1.0', '0.0',
     'A00000001803090000000000B00000', 'A00000001803090000000000B00000', 
     101, null, 'I', 27548);

并检查查询现在是否有效。

同样在表定义中,不要使用 DATA TYPE 作为 NUMBER(X,0),而是使用 NUMBER(X)。

请检查并告诉

于 2013-03-11T04:37:41.347 回答