我搜索了很多,发现了一些类似的案例,但没有一个帮助我让它工作,它们都有些不同,所以我有这个查询:
String insertTableSQL = "INSERT INTO dev_corpus"
+"(corpusid,corpus_name,corpusdesc,corpusimageids,rocf1,rocf2,rocf3,rocc1,rocc2,rocc3,corpusactive,corpusrunfrequency,corpuslastrun,corpuslastsync,rocsettingid,corpusaffinity,corpusterms,corpusdomain) VALUES"
+"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
+"ON DUPLICATE KEY UPDATE "
+"corpusid = VALUE(?)"; // I have also tried VALUES
它向我抛出了这个错误:
ORA-00933: SQL command not properly ended
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
这是我的桌子:
CREATE TABLE "SBOOKS"."DEV_CORPUS"
( "CORPUSID" NUMBER(9,0) NOT NULL ENABLE,
"CORPUS_NAME" VARCHAR2(768 BYTE) NOT NULL ENABLE,
"CORPUSDESC" VARCHAR2(4000 BYTE),
"CORPUSIMAGEIDS" VARCHAR2(768 BYTE),
"ROCF1" FLOAT(63),
"ROCF2" FLOAT(63),
"ROCF3" FLOAT(63),
"ROCC1" FLOAT(63),
"ROCC2" FLOAT(63),
"ROCC3" FLOAT(63),
"CORPUSACTIVE" NUMBER(3,0),
"CORPUSRUNFREQUENCY" NUMBER(3,0),
"CORPUSLASTRUN" DATE,
"CORPUSLASTSYNC" DATE,
"ROCSETTINGID" NUMBER(3,0),
"CORPUSAFFINITY" NUMBER(3,0),
"CORPUSTERMS" VARCHAR2(4000 BYTE),
"CORPUSDOMAIN" NUMBER(3,0),
PRIMARY KEY ("CORPUSID")
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 DEFAULT)
TABLESPACE "DDATA" ENABLE
) 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 DEFAULT)
TABLESPACE "DDATA" ;
你能告诉我有什么问题吗?我尝试在 MYSQL 中运行它给了我同样的错误。你知道我查询的哪一部分是错误的吗?我该如何解决这个问题?
谢谢