You can configure the SQL transformation to process a user-entered query on the
SQL
tab of the SQL transformation. Optionally, you can parameterize the query. When you parameterize the query, you enter the full query in the mapping task.
In the
Properties
panel of the SQL transformation, click the
SQL
tab.
Select the connection to the database or use a parameter.
Set the SQL type to
SQL Query
.
Set the query type to
Entered Query
.
If you do not want to parameterize the query, enter the query in the query editor.
Incoming fields are listed on the
Fields
tab. To add a field to the query, select the field and click
Add
.
You can format the SQL and validate the syntax.
The syntax validation performs a general SQL syntax check but does not verify the SQL against the database. The validation can return a syntax error even though the SQL is valid for the database. In this case, you can still save and run the mapping.
If you update the incoming fields after you configure the query, open the
SQL
tab to refresh the changes.
If you want to parameterize the query, perform the following steps: