Using a parameter in the SQL
You can create a parameter to use in the Datasource field, then call that parameter as part of a query.
For example in the following SQL statement,
SELECT * FROM customer WHERE last_name = 'Smith'
you can replace the value of Smith with the parameter 'pLastName' so the SQL statement becomes:
SELECT * FROM customer WHERE last_name = '?pLastName?'
When creating a parameter, consider the following:
- You must initially create the TI process using an ODBC source. This will populate the the Variables tab. At that point, you can use the variable DATASOURCEQUERY to overwrite the query text box value in the Datasource tab.
- The number of columns from the returned set must match the number when the TI process was developed.
- The data type of columns must also match.
- It is important to enclose the parameter with single quotes when
it is a string parameter. For a numeric parameter, do not use the
single quotes, for example the query using a numeric could be
SELECT * FROM customer WHERE last_name = ?pQuantity?
To create the parameter, use the Advanced Tab in the TurboIntegrator process dialog box to replace the default PO parameter with the parameter you want to use, for example: pLastName.