Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL MANUAL VERSIONS

Ignition 8
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata


Binding Properties to Database Tables

The DB Browse binding is technically equivalent to the SQL Query binding, except that it helps write the queries for you. Using the Database Browse binding type, you can pick the table from a list of tables in each database that you want to pull content from. If you have a fixed range of data you need to return, simply select it in the table, and watch the query get generated.

In the Browse Database tree, you can choose which columns in your table should act as your keys (these columns get put in the WHERE clause based on your selection) and which columns should be used to sort the data (these columns are put in the ORDER BY clause).

This binding type also serves as a convenient jumping-off point for the more flexible SQL Query binding. Construct the basic outline of your query in the DB Browse section, and then select the SQL Query radio button to convert to the new binding type. Your query will be retained and can then be modified manually.


On this page ...


IULocgo


DB Browse Binding


Configuring the Binding

After selecting a table in the Browse Database tree, you can customize which columns the query is selecting by selecting one or more columns under the table to select just the highlighted columns, or selecting the table to use the * symbol to select all columns.

Key Column

The DB Browse binding has the ability to designate key columns within the query. A key column is used within the select query's where clause, and can be given a value. A column is denoted as a key column when it has a key symbol next to it.
Clicking the Key  icon to the right of the Browse Database tree will designate a column as a key column. Alternately, if the highlighted column is already a key column, then clicking the Key  icon will remove that column as a key column.

Sort Order

In the DB Browse binding, you can also sort data  in ascending or descending order. Select the column that you want to sort by and click the Sort  icon. Multiple columns can be used for sorting.


Dynamic Filters

DB Browse bindings also give the ability to bind a property to a key column to allow for dynamic filtering of the returned data. Simply click the binding  icon next to the key column field. This allows you to give the operators some control over the data they are seeing.


IULocgo


DB Browse Binding - Dynamic Filters

  1. In the Designer, drag a Table component and a Text Field component on a window. 
  2. With the Table component selected, click the Binding  icon next to the Data property. 
  3. Chose DB Browse under Binding Types > Database.
  4. Let's pull all the data from this Table except for the id, and filter on state. Remove the Key  from the id column and place it on the state column.



  5. Select the Tank_Number, Lot_ID, Notes, and t_stamp columns. You can do this with Control+Click, or by clicking and dragging in the results table in the upper right.
  6. Instead of statically typing in a value like we in did in the above example, let's make it dynamic using the Text Field. Click the Insert Property Value icon next to the value in the Key Columns section, and select the Text property of the Text Field. 




  7. Notice there is now a property reference in the Key Column as well as the Generated SELECT Query.



  8. Click OK to confirm the binding.
  9. Put the Designer into Preview mode.
  10. Enter the Lot_ID that you want to view. You'll see the Table update to display just the data for that Lot ID. 

         


       


Scalar Query Update

Similar to the SQL Query Binding, the DB Browse Binding has the ability to become bidirectional by doing a database write back when the property being bound is a non-dataset type. In this case, the select query should be configured to only return a single row from a single column.

For example, this option can provide a single value to the Text property of a Text Field component. If you check the Enable Database Writeback checkbox, then any user input will write back to the database. This will automatically generate an update query that will push the input value into the database from the location where the original value was retrieved.

IULocgo


SQL Query Binding - Scalar Query and Update




  • No labels