Web逻辑数据源中的SQL查询执行问题 - ORA-01438

时间:2013-03-08 14:23:49

标签: database oracle weblogic

我有一个简单的插入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);

提前谢谢。

1 个答案:

答案 0 :(得分: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)。

请检查并告诉