Multiple Parameters
To create a query with multiple parameters, simply place a question mark (?) for every parameter you wish to substitute a value for in the query. For example, if you wanted a SQL query to match two WHERE
conditions, collectorname
and tagname
, you could use the following parameterized query:
SELECT* FROM ihtags WHERE collectorname=? AND tagname like ? ORDER BY tagname
When executed, the parameterized SQL query will add the parameters as they are received from the analysis application. In the previous example, the collectorname
parameter would be received first, followed by the tagname
parameter. Your analysis client will order the parameters based on the query it is running.
Note: If you wish to enter wildcard data in your parameterized queries, you must include the wildcard characters as part of the parameter. For instance, in the previous example, if you wanted to find any tagnames with the string iFIX in them, you would pass it the
*iFIX*
parameter.