Closed sonnguyen-dba closed 4 years ago
For tables with primary key only replace MERGE statement or it equivalent to just insert and handle ORA-1. Working on it.
Hi Son, Could you please clone latest code with updated OraTable4SinkConnector.java and TargetDbSqlUtils.java and retest this issue. If this is fixed - please close this issue.
Regards, Aleksei
Hi Aleksej, Thank you for your fixed. Regards, Son
Hi Aleksej, ORA-00927: missing equal sign still exist after you fixed "Oracle MERGE statement for tables with only PK columns".
[2020-10-01 05:44:20,362] WARN Table PM_SPECIALSALEPROGRAM_INVSTT contains only primary key column(s)! (eu.solutions.a2.cdc.oracle.OraTable4SinkConnector:113) [2020-10-01 05:44:20,363] WARN Column list for PM_SPECIALSALEPROGRAM_INVSTT: (eu.solutions.a2.cdc.oracle.OraTable4SinkConnector:114) [2020-10-01 05:44:20,364] WARN SPECIALSALEPROGRAMID, JDBC Type -> DOUBLE (eu.solutions.a2.cdc.oracle.OraTable4SinkConnector:116) [2020-10-01 05:44:20,364] WARN INVENTORYSTATUSID, JDBC Type -> DOUBLE (eu.solutions.a2.cdc.oracle.OraTable4SinkConnector:116) [2020-10-01 05:44:20,385] ERROR Error while executing UPSERT statement merge into PM_SPECIALSALEPROGRAM_INVSTT D using (select ? SPECIALSALEPROGRAMID,? INVENTORYSTATUSID from DUAL) ORACDC on (D.SPECIALSALEPROGRAMID=ORACDC.SPECIALSALEPROGRAMID and D.INVENTORYSTATUSID=ORACDC.INVENTORYSTATUSID) when matched then update set when not matched then insert(SPECIALSALEPROGRAMID,INVENTORYSTATUSID) values(ORACDC.SPECIALSALEPROGRAMID,ORACDC.INVENTORYSTATUSID) (eu.solutions.a2.cdc.oracle.OraTable4SinkConnector:258) [2020-10-01 05:44:20,388] ERROR Error 'java.sql.BatchUpdateException: ORA-00927: missing equal sign ' when put to target system, SQL errorCode = 0, SQL state = 'null' (eu.solutions.a2.cdc.oracle.OraCdcJdbcSinkTask:138) [2020-10-01 05:44:20,390] ERROR java.sql.BatchUpdateException: ORA-00927: missing equal sign
java.sql.SQLException: java.sql.BatchUpdateException: ORA-00927: missing equal sign
Caused by: java.sql.BatchUpdateException: ORA-00927: missing equal sign
(eu.solutions.a2.cdc.oracle.OraCdcJdbcSinkTask:140) [2020-10-01 05:44:20,391] ERROR WorkerSinkTask{id=oracdc-sink-oracle-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted. Error: java.sql.SQLException: java.sql.BatchUpdateException: ORA-00927: missing equal sign (org.apache.kafka.connect.runtime.WorkerSinkTask:565) org.apache.kafka.connect.errors.ConnectException: java.sql.SQLException: java.sql.BatchUpdateException: ORA-00927: missing equal sign
Caused by: java.sql.SQLException: java.sql.BatchUpdateException: ORA-00927: missing equal sign
Caused by: java.sql.BatchUpdateException: ORA-00927: missing equal sign
DDL:
CREATE TABLE PM_SPECIALSALEPROGRAM_INVSTT ( SPECIALSALEPROGRAMID NUMBER, INVENTORYSTATUSID NUMBER DEFAULT -1 NOT NULL, CONSTRAINT PK_SPECIALSALEPROGRAM_INVSTT PRIMARY KEY (SPECIALSALEPROGRAMID, INVENTORYSTATUSID) USING INDEX TABLESPACE DATAINDEX STORAGE (INITIAL 64K MAXEXTENTS UNLIMITED) ) TABLESPACE DATA STORAGE (INITIAL 64K MAXEXTENTS UNLIMITED) LOGGING; Regards, Son