Oracle Batch

Oracle Batch

Certified

Bulk insert rows into Oracle Database using prepared statements

Reads ION-formatted data from Kestra internal storage and performs high-performance batch inserts using JDBC batch operations. Data is processed in chunks (default 1,000 rows) to optimize memory and performance. Supports auto-commit for databases without transaction support. Handles NULL values explicitly to avoid ORA-17041 errors.

yaml
type: io.kestra.plugin.jdbc.oracle.Batch

Fetch rows from a table and bulk insert to another one

yaml
id: oracle_batch
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.jdbc.oracle.Query
    url: jdbc:oracle:thin:@dev:49161:XE
    username: oracle
    password: "{{ secret('ORACLE_PASSWORD') }}"
    sql: |
      SELECT *
      FROM xref
      FETCH FIRST 1500 ROWS ONLY;
    fetchType: STORE

  - id: update
    type: io.kestra.plugin.jdbc.oracle.Batch
    from: "{{ outputs.query.uri }}"
    url: jdbc:oracle:thin:@prod:49161:XE
    username: oracle
    password: "{{ secret('ORACLE_PASSWORD') }}"
    sql: |
      insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

Fetch rows from a table and bulk insert to another one, without using sql query

yaml
id: oracle_batch
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.jdbc.oracle.Query
    url: jdbc:oracle:thin:@dev:49161:XE
    username: oracle
    password: "{{ secret('ORACLE_PASSWORD') }}"
    sql: |
      SELECT *
      FROM xref
      FETCH FIRST 1500 ROWS ONLY;
    fetchType: STORE

  - id: update
    type: io.kestra.plugin.jdbc.oracle.Batch
    from: "{{ outputs.query.uri }}"
    url: jdbc:oracle:thin:@prod:49161:XE
    username: oracle
    password: "{{ secret('ORACLE_PASSWORD') }}"
    table: XREF
Properties

Input file from internal storage

URI of the source file (kestra://) containing rows to insert

The JDBC URL to connect to the database

Default1000

Batch size per executeBatch call

Number of rows sent per JDBC batch before commit; default 1,000

SubTypestring

Columns bound to placeholders

Ordered column names matching ? placeholders; if omitted, placeholder count must match all columns in the input row

Default10

Maximum number of pooled connections

Maximum connections held in the pool for a given URL and credentials. Default 10. Increase for flows that run many concurrent queries against the same database to avoid waiting for an available connection. Ignored when connectionPooling is false or for embedded drivers.

Defaulttrue

Reuse database connections via a connection pool

When true (default), connections are pooled and reused across executions, keyed by URL and credentials, removing the connect and TLS-handshake cost on each run. Set to false if your SQL relies on session state persisting on the connection (for example SET search_path, session-scoped temp tables or variables), since pooled connections are reused. Embedded drivers (DuckDB, SQLite, MS Access) never pool regardless of this setting.

DefaultAUTO
Possible Values
AUTOSTREAMLOCAL

Input handling strategy

Controls how input is read during processing and retries. AUTO buffers small files locally (<= localBufferMaxBytes) and streams large files. STREAM always streams from internal storage. LOCAL always buffers input to a local temporary file before processing.

Default104857600

Maximum number of bytes buffered locally

Used by AUTO and LOCAL input handling. In AUTO, files larger than this threshold are streamed. In LOCAL, files larger than this threshold fail fast.

Default3

Maximum number of retries for transient failures

Retries are attempted only for transient failures such as temporary I/O and recoverable SQL errors.

The database user's password

Reference (ref) of the pluginDefaults to apply to this task.

Defaulttrue

Resume from the last successfully committed chunk on retry

DefaultPT1S

Delay between retry attempts

Uses ISO-8601 duration format, for example PT1S.

DefaultINPUT
Possible Values
NONEINPUTALL

Controls which failures are retried

INPUT retries input handling failures, ALL retries all retryable failures.

Parameterized INSERT statement to execute

Prepared INSERT with ? placeholders for each bound column. Example: INSERT INTO VALUES (?, ?, ?) for three columns; use column list if inserting a subset

Table used to auto-discover columns

Retrieves column names from the given table when columns is empty. If sql is also omitted, an INSERT statement is generated automatically using the discovered columns

The time zone id to use for date/time manipulation. Default value is the worker's default time zone id

The database user

Total rows read

Rows inserted or updated

Unitqueries

The number of batch queries executed.

Unitrecords

The number of records processed.

Unitrecords

The number of records updated.