简体   繁体   中英

java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier

CREATE TABLE S_6500_67_SNAPSHOT_ROWDATA_201([MATERIAL] varchar2(2000), [OBJVERS] varchar2(2000), [CHANGED] varchar2(2000), [AF_COLOR] varchar2(2000), [AF_FCOCO] varchar2(2000), [AF_GENDER] varchar2(2000), [PROD_HIER] varchar2(2000),  [WIDTH] decimal)

when i run the above query i get the exception:

java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier

The correct syntax for creating table in Oracle is

  CREATE TABLE table_name
( 
  column1 datatype [ NULL | NOT NULL ],
  column2 datatype [ NULL | NOT NULL ],
  ...
  column_n datatype [ NULL | NOT NULL ]
);

So, just remove the square brackets from column name and I think you should write your query as follows

CREATE TABLE S_6500_67_SNAPSHOT_ROWDATA_201(MATERIAL varchar2(2000), OBJVERS varchar2(2000), CHANGED varchar2(2000), AF_COLOR varchar2(2000), AF_FCOCO varchar2(2000), AF_GENDER varchar2(2000), PROD_HIER varchar2(2000),  WIDTH decimal)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM