Skip to main content
Executes a query against the database.

Required Parameters

  • driver: The JDBC driver class name in the cross-platform edition or the ADO.NET provider name in the .NET edition.
  • conn: The connection string or database URL.
  • query: The SQL query string.

Optional Parameters

  • commandtimeout: CommandTimeout, in seconds, for the operation to complete. Zero (0) means no timeout. The default is 60.
  • fromrow: Number of rows to skip from start. The default is 0.
  • maxrows: Maximum number of rows to return from the database. Set to -1 (the default) to get all results.
  • paramname#: The parameter names.
  • paramvalue#: The parameter values.
  • paramtype#: The parameter types.
  • transactionid: The Id of the transaction.
  • querypassthrough: Pass the query to the operation as-is instead of performing client-side validation and syntax correction.

Output Attributes

  • db:\: Output varies based on the query.

Example

This example executes a stored procedure in a MySQL database using the cross-platform edition of . It SELECTs all films from the film table where the rating is PG-13 and outputs a file for each film. The filename is the film title, and the contents of the file are the film description. The paramname/paramvalue attributes are used to demonstrate how that can work in a script.
You can modify the example above to target other databases as long as the driver is installed on the machine where is installed and running. Adjusting this example for .NET involves changing the driver and conn inputs as follows: