{"record":{"id":"53bbf634b47cf89b","repo":"apache/seatunnel","slug":"oracle-insert-mode-append-values-only-supports-ora","errorCode":null,"errorMessage":"oracle_insert_mode=APPEND_VALUES only supports Oracle JDBC sink.","messagePattern":"oracle_insert_mode=APPEND_VALUES only supports Oracle JDBC sink\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/JdbcOutputFormatBuilder.java","lineNumber":380,"sourceCode":"        }\n        final String insertPrefix = \"INSERT\";\n        if (!insertSQL.regionMatches(true, 0, insertPrefix, 0, insertPrefix.length())) {\n            throw new IllegalArgumentException(\n                    \"oracle_insert_mode=APPEND_VALUES only supports generated INSERT statements.\");\n        }\n        String appendValuesSQL =\n                insertPrefix + \" /*+ APPEND_VALUES */\" + insertSQL.substring(insertPrefix.length());\n        log.info(\"Oracle APPEND_VALUES insert mode is enabled, generated SQL: {}\", appendValuesSQL);\n        return appendValuesSQL;\n    }\n\n    private static void validateOracleInsertMode(\n            JdbcDialect dialect, JdbcSinkConfig jdbcSinkConfig, List<String> primaryKeys) {\n        if (!isOracleAppendValuesConfigured(jdbcSinkConfig)) {\n            return;\n        }\n        if (!DatabaseIdentifier.ORACLE.equals(dialect.dialectName())) {\n            throw new IllegalArgumentException(\n                    \"oracle_insert_mode=APPEND_VALUES only supports Oracle JDBC sink.\");\n        }\n        if (primaryKeys != null && !primaryKeys.isEmpty()) {\n            throw new IllegalArgumentException(\n                    \"oracle_insert_mode=APPEND_VALUES only supports insert-only writes without primary keys.\");\n        }\n    }\n\n    private static boolean isOracleAppendValuesConfigured(JdbcSinkConfig jdbcSinkConfig) {\n        return JdbcSinkConfig.OracleInsertMode.APPEND_VALUES.equals(\n                jdbcSinkConfig.getOracleInsertMode());\n    }\n\n    static Function<SeaTunnelRow, SeaTunnelRow> createKeyExtractor(int[] pkFields) {\n        return row -> {\n            Object[] fields = new Object[pkFields.length];\n            for (int i = 0; i < pkFields.length; i++) {\n                fields[i] = row.getField(pkFields[i]);","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/JdbcOutputFormatBuilder.java#L362-L398","documentation":"Thrown by JdbcOutputFormatBuilder.validateOracleInsertMode when oracle_insert_mode=APPEND_VALUES is configured but the active JDBC dialect is not Oracle. The APPEND_VALUES hint is Oracle-specific syntax and is meaningless (and invalid) on other databases, so the builder rejects the combination early.","triggerScenarios":"Config contains oracle_insert_mode=APPEND_VALUES while dialect/dialectName() is not ORACLE — e.g. driver set to MySQL, PostgreSQL, etc.","commonSituations":"Copying an Oracle sink config template to another database; generic driver selection where the Oracle-only option was left enabled.","solutions":["Remove the oracle_insert_mode option if the target is not Oracle","Switch the dialect/driver back to Oracle if Oracle was intended","Use the dialect's own bulk-load/optimization options for the non-Oracle database"],"exampleFix":"// before\nurl = \"jdbc:mysql://host/db\"\noracle_insert_mode = \"APPEND_VALUES\"\n// after\nurl = \"jdbc:mysql://host/db\"","handlingStrategy":"validation","validationCode":"// ensure option matches dialect\nif (config.get(\"oracle_insert_mode\") != null && !dialectName.equals(\"oracle\")) {\n  throw new IllegalArgumentException(\"oracle_insert_mode is Oracle-only\");\n}","typeGuard":null,"tryCatchPattern":"try { builder.build(); } catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"only supports Oracle\")) { /* remove option and rebuild */ }\n}","preventionTips":["Keep Oracle-specific options in Oracle-only config profiles","Verify dialect/driver pairs before submitting jobs","Lint configs per dialect"],"tags":["oracle","jdbc","config","dialect"],"backgroundTag":"conflicting-config-options","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}