The SQLRunner plugin is a node step plugin included with Rundeck Enterprise that executes a .sql script against a JDBC URL.

Usage

Add “SQLRunner Plugin” as a step in a workflow.

Provider name: org.rundeck.sqlrunner.SQLRunnerNodeStepPlugin

Configuration

  • SQL script path: Path to the sql script
  • SQL inline script: Alternative to sql script path.
  • Variables: comma separated list of variables values too be used as Prepared Statement.
  • JDBC Driver class name: e.g. com.mysql.jdbc.Driver
  • JDBC url: full JDBC url to use for connections
  • Database username connection username
  • Database password connection password
  • Auto commit flag: if true, a Connection::commit() will be called after the script.

Usage of variables

the variable text field can receive a comma separated list of variables values too be used as Prepared Statement, this is, replacing a ? variable in the script. The list of variables can be a list of values comma separated or using the format type:value. If you omit the type, it’s going to be passed as generic object to the JDBC connector, this works only on some cases.

Example Job XML

Example Job XML using variables