Skip to main content
Version: 8.1

Named Query Bindings

Inductive University

Named Query Binding

Watch the video

Binding Properties to a Named Query

The Named Query binding is where you can configure a property to call a Named Query that you had previously created in the project. Using Named Query binding instead of a SQL Query or DB Browse binding helps to make your project more secure due to the built-in Security Zone and User Role restrictions.

Polling Mode

Each Named Query binding type will use polling to determine when to update the results and run the query again. The Polling Mode dictates how often the query will execute, and works in a similar fashion to polling on other bindings.

Creating Named Queries

In order to use a Named Query, first one has to be created. You might already have some that another developer has created but if not, you will have to make one by going to the Named Query section in the Designer or converting a SQL query.

Using Named Queries on Dataset Properties

The majority of your Named Query bindings will most likely be on a dataset type property. When placed on a Dataset type property, only a single Named Query needs to be specified. An explanation of the various fields on the binding are detailed below:

  • Path: Here you can enter in the path to the Named Query. Click on the Search magnifying glass button icon to get a list of all available Named Queries that you can choose from.
  • Parameters: Here you can see a table of all defined Named Query parameters. You can pass in property or Tag values to the parameters by first highlighting the parameter and then selecting either the Insert Property property button icon or the Tag tag button icon.
  • Query: The Query section shows what Named Query looks like. Note that you can't modify the query on this page.
  • Polling Mode: Here you can set the Polling Mode of the Named Query binding based on the Polling Rate.
  • Retain Rows: If true, any rows that you have returned within the Designer will be saved along with the window. This may slow window load times.

Named Query Binding: Using Named Queries on Dataset Properties

Using Named Queries on Scalar Properties

When placed on a non-dataset type property (such as a String or Integer), then the Named Query binding allows for a second Named Query to be specified in the case that the user can update the value on the property. This provides an opportunity to both return and update values in the database from the same component.

The configuration is very similar to a Named Query binding on a dataset property. You need to specify a Named Query path, set up your Parameters, and choose a Polling Mode. You can finish setup at this point, leaving the update query disabled so that the property will simply pull the value from the database.

However, if you want the binding to be bidirectional, you need to specify an UPDATE query. This works similar to a SELECT query, in that you need to select the path to the Named Query and set up any Parameters. However, it is important to make sure that the Named Query chosen for the UPDATE query is in fact set up as an UPDATE query by setting the Query Type property on the Authoring section of the Named Query.

New in 8.1.27
Now when you configure an UPDATE query, clicking the This button will insert {this} as a Value for the selected parameter.