Select from Table
Use the Select from Table activity to select rows from a table.
Usage
Complete the following properties to use this activity:
- Select - Specify the following information or click the Variable Reference icon to choose a variable:
Input Table - Enter the table name. This should be the variable output from a workflow or activity.
Note: If you are unable to choose the table you want from the variable browser, ensure that the activity that created the table has the Persist Table check box checked in its properties.
Where Clause - Enter the criteria for selecting the rows or click the Variable Reference icon to choose a variable.
Persist Table - Check this check box to store the output of this activity as a variable.
Number of Rows - Click the radio button to specify how many rows are selected:
- All Rows - Select all rows that match the Where Clause.
- At Most - Select up to the number of rows specified.
- First N Rows - Enter the maximum number of rows to select.
Sorting - Click the radio button to specify how the selected rows are sorted:
- No Sort - The selected rows will be returned with no sorting.
- Sort By - The selected rows will be sorted by Column Name
- Column Name - Enter the name of the column to sort by.
- Order - Click the radio button to specify whether the sorting will be Ascending or Descending.
Example
This example shows how to select rows from a table.
In the Select section of the activity properties, you configure the criteria for selecting rows. The following example shows selecting rows from a table where the value in the id column is equal to 3 and for each matching row, all of the columns are selected.
The next section is where you define how many rows to select and provide sorting options. In the following example, up to 5 rows are selected and it is sorted by the id column in ascending order: