jdbc_modifyΒΆ

jdbc_modify executes create, insert or update statement specified in query (for each record in the input record stream ?).

jdbc_modify(uri:uri_str, query:query_str)
jdbc_modify(uri:uri_str, query:query_str, username:uname_str, password:pswd_str)
where:
  • uri_str - is Jdbc connection string. The format of string depends on the particular Jdbc driver of the database.
  • query_str - create, insert, update or delete SQL statement.
  • uname_str - username of database user. Optional.
  • pswd_str - password of database user. Optional.

Note

Respective Jdbc drivers must be enabled in configuration.

On successful execution jdbc_update outputs following:

  • uri - Jdbc connection uri to the database
  • table - affected table
  • rows - number of rows affected by operation
  • field_count - input field count

Example: delete table test

1
dual | jdbc_modify(uri:'jdbc:sqlite:file:/tmp/test.db', query:'DROP TABLE test');

Note

In order for this example to work: * SQLite JDBC driver must be enabled in SpectX configuration and * an SQLite database must exist in the path specified by JDBC connection string