Troubleshooting Oracle Community Connector Issue with SQLSyntaxErrorException


The user is facing an issue with the Oracle community connector while injecting data into Oracle. The error message indicates a java.sql.SQLSyntaxErrorException with ORA-01745. The user is looking for information on where to find logs for more details.


Hello everyone,
I’m using the Oracle community connector to inject data into Oracle
So far, i’m having this issue

  "externalMessage" : "Something went wrong in the connector. See the logs for more details.",```
Where can i find logs for more details ?



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here]( if you want to access the original thread.

[Join the conversation on Slack](

["oracle-community-connector", "data-injection", "sqlsyntaxerrorexception", "logs"]

I add the full stack trace

        at oracle.jdbc.driver.T4CTTIoer11.processError( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CTTIoer11.processError( ~[ojdbc8-]
        at oracle.jdbc.driver.T4C8Oall.processError( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CTTIfun.receive( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CTTIfun.doRPC( ~[ojdbc8-]
        at oracle.jdbc.driver.T4C8Oall.doOALL( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows( ~[ojdbc8-]
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout( ~[ojdbc8-]
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal( ~[ojdbc8-]
        at oracle.jdbc.driver.T4CPreparedStatement.executeInternal( ~[ojdbc8-]
        at oracle.jdbc.driver.OraclePreparedStatement.execute( ~[ojdbc8-]
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute( ~[ojdbc8-]
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute( ~[HikariCP-5.0.1.jar:?]
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute( ~[HikariCP-5.0.1.jar:?]
        at$insertRawRecordsInSingleQuery$1( ~[io.airbyte.airbyte-integrations.connectors-destination-oracle-24.0.2.jar:?]
        at io.airbyte.db.jdbc.DefaultJdbcDatabase.execute( ~[io.airbyte.airbyte-db-db-lib-24.0.2.jar:?]
        at ~[io.airbyte.airbyte-integrations.connectors-destination-oracle-24.0.2.jar:?]
        at ~[io.airbyte.airbyte-integrations.connectors-destination-oracle-24.0.2.jar:?]
        at io.airbyte.integrations.destination.jdbc.JdbcBufferedConsumerFactory.lambda$recordWriterFunction$2( ~[io.airbyte.airbyte-integrations.bases-bases-destination-jdbc-24.0.2.jar:?]
        at io.airbyte.integrations.destination.record_buffer.InMemoryRecordBufferingStrategy.flushAllBuffers( ~[io.airbyte.airbyte-integrations.bases-base-java-24.0.2.jar:?]
        at io.airbyte.integrations.destination.record_buffer.InMemoryRecordBufferingStrategy.addRecord( ~[io.airbyte.airbyte-integrations.bases-base-java-24.0.2.jar:?]```
It led us to this query

``` // Adapted from SqlUtils.insertRawRecordsInSingleQuery to meet some needs specific to Oracle syntax
  private static void insertRawRecordsInSingleQuery(final String tableName,
                                                    final String columns,
                                                    final String recordQueryComponent,
                                                    final JdbcDatabase jdbcDatabase,
                                                    final List&lt;AirbyteRecordMessage&gt; records,
                                                    final Supplier&lt;UUID&gt; uuidSupplier)
      throws SQLException {
    if (records.isEmpty()) {

    jdbcDatabase.execute(connection -&gt; {

      // Strategy: We want to use PreparedStatement because it handles binding values to the SQL query
      // (e.g. handling formatting timestamps). A PreparedStatement statement is created by supplying the
      // full SQL string at creation time. Then subsequently specifying which values are bound to the
      // string. Thus there will be two loops below.
      // 1) Loop over records to build the full string.
      // 2) Loop over the records and bind the appropriate values to the string.
      // The "SELECT 1 FROM DUAL" at the end is a formality to satisfy the needs of the Oracle syntax.
      // (see <> for details)
      final StringBuilder sql = new StringBuilder("INSERT ALL ");
      records.forEach(r -&gt; sql.append(String.format("INTO %s %s VALUES %s", tableName, columns, recordQueryComponent)));
      sql.append(" SELECT 1 FROM DUAL");
      final String query = sql.toString();
      try (final PreparedStatement statement = connection.prepareStatement(query)) {
        // second loop: bind values to the SQL string.
        int i = 1;
        for (final AirbyteRecordMessage message : records) {
          // 1-indexed
          final JsonNode formattedData = StandardNameTransformer.formatJsonPath(message.getData());
          statement.setString(i, uuidSupplier.get().toString());
          statement.setString(i + 1, Jsons.serialize(formattedData));
          statement.setTimestamp(i + 2, Timestamp.from(Instant.ofEpochMilli(message.getEmittedAt())));
          i += 3;

Could it be because table name and column is not escape in this query `String.format("INTO %s %s VALUES %s", tableName, columns, recordQueryComponent)`  and are using reserved oracle keyword ?

This is the failing query :

INTO ADMIN.airbyte_raw_FRECAFS_FREC_AFSSAPS (\"_AIRBYTE_AB_ID\", \"_AIRBYTE_DATA\", \"_AIRBYTE_EMITTED_AT\") VALUES (:138658 , :138659 , :138660 )

It appears to be a <Issues · airbytehq/airbyte · GitHub issue> but seems closed