# IBM Db2 - Select rows using custom SQL
This action lets you select rows that match a custom SQL query.
Learn about some Improving the performance of SQL procedures (opens new window).
# Select rows with custom SQL
# Input fields
- SQL
- Required field
- The custom SQL statement that runs on selected rows. This generates the output datatree.
Wrap datapills in single quote characters,'
.
Do not add a;
at the end of your SQL query; this causes the step to fail.
Do not add a LIMIT clause to restrict query size. Use the Limit input field instead.
- Parameters
- Optional field
- Assign values to your bind variables
- Order by
- Optional field
- Order of rows to return, such as
updated_at DESC
.
- Limit
- Optional field
- The maximum number of rows to return. The default is 100, and the highest possible number of rows is 50000 rows.
- Offset
- Optional field
- The option to fetch only a page of results from the entire results set.
For example, to skip the first 100 rows of the selected results set, input 100 to this field.
The default is 0.
- Output fields
- Optional field
- Define the expected fields of each retrieved Document. Enables users to generate datapills for use in downstream systems, or to drive Recipe logic.
- Output CSV?
- Optional field
- Select Yes to output a CSV string of the selected data.
# Output fields
- rows
- Array of JSON objects, where each object represents a retrieved row.
- rows_count
- Number of retrieved rows.
Last updated: 2/20/2024, 5:01:26 PM