|
Parameterized Queries |
Top Previous Next |
|
Parameterized queries are used to specify some parameters during query execution. Source data for the parameterization engine is written XML format, rather than in AggreGate Query Language. When the Parameterized option is enabled in the query settings, the query engine considers the query text as parameterization data. See Parameterization Engine for more info. Here is an example of parameterization data: Query Text: <form> <format> <![CDATA[ <<byusername><B><D=Filter by User Name>> <<username><S><D=User Name>> ]]> </format> <expression> SELECT * FROM users.*:userInfo <p enabled="{byusername}">WHERE userInfo$username LIKE '%<e>{username}</e>%'</p> </expression> </form> This query will ask for two parameters upon execution:
If the user checks "Filter by User Name", final parameterized query text will be SELECT * FROM users.*:userInfo WHERE userInfo$username LIKE '%text_entered_in_User_Name_field%' i.e. only users whose usernames include the specified text will be shown. If "Filter by User Name" is not checked, all users will be shown because parameterized query text will be SELECT * FROM users.*:userInfo |