Create a parameterized query

To create your parameterized query in the UI, navigate to the Query Editor. See the section on accessing the Query Editor for more instructions.

Use the '$' preface to enter a query parameter into your query in the text editor. Next, select the Query parameters tab next to the Console add the missing value for the key. The query cannot be executed if you neglect to add a value to any of the required keys. An alert icon ( An alert icon. ) appears in the Query Parameters section next to any empty Value input fields.

NOTE
If your query does not take parameters, you can still enter unnecessary parameters within the Query Editor. The Query Editor ignores all unnecessary key-value pairs and they have no effect on the execution or the results of the query.

The Query Editor with a parameterized query and the Query parameters section highlighted.

TIP
Change tabs from Query parameters to Console to view the console output of the query.

Use query logs details to check parameter values

You cannot save parameters within templates as the values used are not persistent. However, you can check the Query log details page to find the parameter values used in a query run. In this case, the logs do not indicate that the query was a parameterized query. See the query logs documentation for instructions on how to find the values used.

The query logs view with the SQL of a parameterized query highlighted in the details section.

Schedule a parameterized query

Parameter values are saved when you schedule a parameterized query. To schedule a parameterized query, follow the typical process to create a scheduled query as described in the guide to create a query schedule, then enter the parameter values to be used in the query run. This UI section only appears for parameterized queries. See the section on setting parameters for a scheduled parameterized query for specific instructions.

TIP
Query Service supports prepared statements through the use of parameterized queries. See the prepared statements syntax guide for more information on the SQL syntax involved.