You can define parameters in the SQL statement of a query layer, which allows the people using the query layer to update the parameter values dynamically before ArcGIS Pro sends the query to the database to retrieve the data. You can use the following two types of parameters in query layers:
- Range parameters connect numeric or temporal values dynamically to the range and time sliders, which allows you to change the numeric or time range using the slider.
- Discrete parameters allow you to update a query with literal values before running the query.
To set up parameters on a query layer, see Define parameters in a query layer.
Update range parameter values
Range parameters that reference date-time values make the query layer time aware. The Time tab on the Layer Properties dialog box specifies that the layer time is bound to a parameter in the SQL query, along with the name of the parameter. Use the time slider to update the value or values for the range parameter.
Range parameters that reference numeric data (integer or double) are connected to the range slider. Use the range slider to update the value or values for the range parameter. You can have more than one range parameter referencing numeric data in the layer. Each one is associated with a range that can be managed from the Range tab on the Layer Properties dialog box. Click a range to modify its properties. The range field indicates that it is bound to the parameter defined in the SQL query.
Update discrete parameter values
When a discrete parameter is declared in a query layer, you can update or limit the parameter value when you interact with the query layer in a map or scene. For example, on a layer showing earthquake locations, a discrete parameter can be set up so that only earthquakes with magnitude 6 or higher are shown by default. You can change that value directly in the layer without needing to modify the source SQL query. A discrete parameter can contain a single value or a list of choices. A query layer can support more than one discrete parameter.
Follow these steps to update the value of a discrete parameter defined on a query layer:
- Right-click the query layer in the Contents pane and click Properties .
- On the Layer Properties dialog box, click the Query Parameter tab to see available discrete parameters for the layer. A query layer can have any number of discrete parameters listed, named either by the parameter name or the alias if one was supplied when the parameter was defined.
- Click a filter row in the table, and update the value as desired. In the case of multiple values, the value cell is a pull-down menu with check boxes for the options. Optionally modify the filter value by typing new values into the cell, separated by commas.
- To reset the values to the way they are defined by the discrete parameter in the SQL query defining the layer, click the Reset button.