我正在尝试在 oracle 中进行合并:
preparedStatement = dbConnection.prepareStatement("MERGE INTO dev_corpus a " +
"USING (SELECT ? corpusid, ? corpus_name, ? corpusdesc, ? corpusimageids, ? rocf1, ? rocf2, ? rocf3, ? rocc1, ? rocc2, ? rocc3, ? corpusactive, ? corpusrunfrequency, ? corpuslastrun, ? corpuslastsync, ? rocsettingid, ? corpusaffinity, ? corpusterms, ? corpusdomain FROM dual) incoming " +
"ON (a.corpusid = incoming.corpusid ) " +
"WHEN MATCHED THEN " +
"UPDATE SET (a.corpus_name = incoming.corpus_name AND a.corpusdesc = incoming.corpusdesc AND a.corpusimageids = incoming.corpusimageids AND a.rocf1 = incoming.rocf1 AND a.rocf2 = incoming.rocf2 AND a.rocf3 = incoming.rocf3 AND a.rocc1 = incoming.rocc1 AND a.rocc2 = incoming.rocc2 AND a.rocc3 = incoming.rocc3 AND a.corpusactive = incoming.corpusactive AND a.corpusrunfrequency = incoming.corpusrunfrequency AND a.corpuslastrun = incoming.corpuslastrun AND a.corpuslastsync = incoming.corpuslastsync AND a.rocsettingid = incoming.rocsettingid AND a.corpusaffinity = incoming.corpusaffinity AND a.corpusterms = incoming.corpusterms AND a.corpusdomain = incoming.corpusdomain) " +
"WHEN NOT MATCHED THEN " +
"INSERT (a.corpusid, a.corpus_name, a.corpusdesc, a.corpusimageids, a.rocf1, a.rocf2, a.rocf3, a.rocc1, a.rocc2, a.rocc3, a.corpusactive, a.corpusrunfrequency, a.corpuslastrun, a.corpuslastsync, a.rocsettingid, a.corpusaffinity, a.corpusterms, a.corpusdomain) " +
"VALUES (incoming.corpusid, incoming.corpus_name, incoming.corpusdesc, incoming.corpusimageids, incoming.rocf1, incoming.rocf2, incoming.rocf3, incoming.rocc1, incoming.rocc2, incoming.rocc3, incoming.corpusactive, incoming.corpusrunfrequency, incoming.corpuslastrun, incoming.corpuslastsync, incoming.rocsettingid, incoming.corpusaffinity, incoming.corpusterms, incoming.corpusdomain)");
我得到这个错误:
ORA-01747: invalid user.table.column, table.column, or column specification
java.sql.SQLSyntaxErrorException: ORA-01747: invalid user.table.column, table.column, or column specification
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1328)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3593)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3674)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1354)
at com.mycompany.datalayer.DB.insertToTaxonomy(DB.java:261)
at com.mycompany.datalayer.DB.restoreBackUp(DB.java:94)
at com.mycompany.datalayer.DB.startProcess(DB.java:56)
at com.mycompany.oraclebackup.App.main(App.java:13)
现在,我检查了它们是否正确的列名。你知道是什么问题吗?我该如何解决?(ps:我没有使用休眠)
谢谢!