无法在Oracle中创建索引

时间:2019-02-07 07:58:47

标签: sql oracle11g

我执行了此sql脚本

create table NIEKI_OBO_RESULT_LOG (
  DELETE_FLAG CHAR(1) default '0' not null
  , REG_DATE TIMESTAMP(3) not null
  , REG_UID CHAR(7) not null
  , MOD_DATE TIMESTAMP(3) not null
  , MOD_UID CHAR(7) not null
  , NIEKI_OBO_RESULT_LOG_KEY CHAR(15) not null
  , DC_CODE CHAR(2)
  , MU_CODE CHAR(3) not null
  , WH_CODE CHAR(3)
  , WH_TO_CODE CHAR(3)
  , DENPYO_TYPE_CODE CHAR(2)
  , BRH_CODE CHAR(3) not null
  , CUST_CODE CHAR(6) not null
  , DISPATCH_CODE NCHAR(8) not null
  , MAGUCHI_CODE CHAR(5)
  , DISPATCH_NAME NVARCHAR2(20)
  , FOREIGN_FLAG CHAR(1) default '0' not null
  , FOREIGN_MAGUCHI_CODE CHAR(5)
  , ALLOC_CARS_CODE CHAR(12)
  , NOTEN_NO CHAR(10) not null
  , ONRAIL_NO CHAR(10)
  , SO_NO CHAR(10)
  , SSO_NO NCHAR(10)
  , DUE_DATE TIMESTAMP(3)
  , ORIGINAL_DATE TIMESTAMP(3)
  , ITEM_NAME CHAR(27) not null
  , OBO_RESULT_QTY NUMBER(9, 0) default 0 not null
  , ELEVEN_SUPPLIED_QTY NUMBER(9, 0) default 0 not null
  , NZ_SUPPLIED_QTY NUMBER(9, 0) default 0 not null
  , OBO_TOTAL_QTY NUMBER(9, 0) default 0 not null
  , REV_CARRY_QTY NUMBER(9, 0) default 999999999 not null
  , REV_CARTON_QTY NUMBER(9, 0) default 0 not null
  , REV_PIECE_QTY NUMBER(9, 0) default 0 not null
  , REV_PIECE_CARTON_QTY NUMBER(3, 0) default 0 not null
  , REV_PACK_UNIT_CODE CHAR(2)
  , REV_CARTON_TYPE_CODE CHAR(3)
  , CARTON_PRICE NUMBER(17, 5) default 0 not null
  , CARTON_RATE NUMBER(17, 9) default 0 not null
  , PACK_UNIT_CODE CHAR(2)
  , CLOSING_DATE TIMESTAMP(3)
  , CONFIRM_DATE TIMESTAMP(3)
  , NIEKI_PRICE NUMBER(17, 5) default 0 not null
  , PROCESS_SIGN CHAR(1)
  , RELAY_SIGN CHAR(1) default ' ' not null
  , OBO_KEY CHAR(15)
  , OBO_QTY NUMBER(9, 0) default 0 not null
  , OBO_LOT_BASE_DATE TIMESTAMP(3)
  , OBO_LOT_BAT_FLAG CHAR(1) default '0' not null
  , ORDER_STATUS_SIGN CHAR(1)
  , SUSPEND_FLAG CHAR(1) default '0' not null
  , PC_CODE CHAR(5)
  , GROUP_NO CHAR(7)
  , CC_CODE CHAR(4)
  , CARTON_TYPE_CODE CHAR(3)
  , SALES_PRICE NUMBER(17, 5) default 0 not null
  , ORIGINAL_BRH_CODE CHAR(3) not null
  , ORIGINAL_CUST_CODE CHAR(6) not null
  , ORIGINAL_DISPATCH_CODE NCHAR(8) not null
  , CUST_PART_NAME NCHAR(20)
  , CARRY_QTY NUMBER(9, 0) default 999999999 not null
  , ITEM_WEIGHT NUMBER(21, 7) default 0 not null
  , AIR_SIGN CHAR(1)
  , FOREIGN_SHIJI_NO CHAR(10)
  , YOSANMOTO_CODE CHAR(4)
  , CUST_NAME NVARCHAR2(50)
  , CARTON_QTY NUMBER(9, 0) default '0' not null
  , PIECE_CARTON_QTY NUMBER(3, 0) default '0' not null
  , PIECE_QTY NUMBER(9, 0) default '0' not null
  , INCOMING_DATE TIMESTAMP(3) not null
  , PROD_MU_CODE CHAR(3)
  , SUP_NAME NCHAR(50)
  , MINUS_FLAG CHAR(1) default '0' not null
  , FOREIGN_SECTION_CODE CHAR(2)
  , AFTER_PROCESS_FLAG CHAR(1) default '0' not null
  , SUP_CODE CHAR(5)
  , constraint NIEKI_OBO_RESULT_LOGPX primary key (NIEKI_OBO_RESULT_LOG_KEY)
);

create index NIEKI_OBO_RESULT_LOG_IX1
  on NIEKI_OBO_RESULT_LOG(DC_CODE,WH_CODE,ORDER_STATUS_SIGN,"SYS_NC00076$",MAGUCHI_CODE);

create index NIEKI_OBO_RESULT_LOG_IX2
  on NIEKI_OBO_RESULT_LOG(NOTEN_NO);

但是发生了错误:

Error starting at line : 80 in command -
create index NIEKI_OBO_RESULT_LOG_IX1
  on NIEKI_OBO_RESULT_LOG(DC_CODE,WH_CODE,ORDER_STATUS_SIGN,"SYS_NC00076$",MAGUCHI_CODE)
Error report -
ORA-00904: "SYS_NC00076$": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:    
*Action:

1 个答案:

答案 0 :(得分:1)

根据您的create table命令,您的表不包含名称为"SYS_NC00076$"的字段。因此,可以将此字段添加到表中或将其从create index

中删除