# IBM Db2 - Run custom SQL

This action enables you query IBM Db2 using a custom SQL string. With it, you can run Data Manipulation Language (DML) statements like INSERT, UPDATE, SELECT and DELETE. You can also run Data Definition Language (DDL) commands, like CREATE, ALTER and DROP.

# Run custom SQL

# Input fields

SQL
Required field
The required SQL code for selecting rows from your Db2 instance.

If you provide multiple SQL statements, the system runs all statements. However, it only returns the results of the last statement. You must separate statements using the semicolon character, ;.

Wrap datapills in single quote characters, '.
Output fields
Optional field
Define the expected fields of each retrieved row. This enables Workato to generate datapills it can use in downstream systems, or to drive Recipe logic. If you do not expect or require return values, ignore this field.

# Output fields

rows
List of rows returned from the SQL execution.
rows_affected
Reports the number of rows inserted, updated, or deleted from the SQL string. When running SELECT statements, this will return nil. When executing a DDL (for example, creating a table), the value 0 will be returned.


Last updated: 2/20/2024, 5:01:26 PM