SQLQuery |
Top Previous Next |
The SQLQuery step executes an SQL statement and optionally sets macro values that may be used in subsequent steps.
This step's behavior is independent of the job's current file set.
Setting Macro Values When the value of is_select is true the results of the query are loaded into the %stepname[] macros produced by this step.
Suppose the step was named "sqlquery" and the following query statement was executed:
select col1, col2 from table1
The first row returned by the database would be used to populate macros as follows:
%sqlquery[col1] = The value of col1 on the first returned row. %sqlquery[col2] = The value of col2 on the first returned row.
These values are not set if the step fails because no rows are returned.
Example Usage:
|