Querying Data from Database
Use binding to bring back data from your database. By using the Polling Mode of the property binding, you can specify how often or at what rate you want to bring back the data.
To display data from the database on a table component
I f a database is connected to your ignition server, you can display data from that database on a table component.
-
In the Designer, from the Component Palette, drag a Table or Power Table component to your window.
While the component is selected, you can see all the properties that are related to the component in the Property Editor.
-
In the Property Editor, click the binding icon of the Data property.
The Property Binding window is displayed.
-
Select the DB Browse database option.
-
Under the Browse Database box, find the table from the list of database connections and expand the table to inspect the table's columns.
-
By default, the query is built with a where clause. If you want to return all the data from the table, deselect the primary key option associated with the table's primary key by selecting the column and clicking the Key icon. To access the key column, select the column that is bold and then deselect the Key icon.
-
To choose which columns are returned, select individual columns from the column selector, or hold the shift button and select multiple columns.
-
Select the Polling Mode to specify how the Client will refresh the table data with new information from the database.
When Polling Mode is set to OFF, this ensures the SQL query on a SQL binding only runs when the window is opened or a referenced property changes value .
As you build a query with this method, the resulting SQL statement is being built in the bottom part of the property binding management screen.