Description

Learn how to 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.

Video recorded using: Ignition 7.9

Transcript

(open in window)

[00:00] Ignition makes interacting with your connected databases quite simple. One of the easiest tasks to accomplish is querying and displaying data from your database. The first thing we have to do is add a table component to the window. You do this by simply clicking on the table component, and dragging it down on to your window. Once it appears, you can resize it as need be. With the table component selected, over here on the left-hand side, you'll see the property editor. And this lists out all the properties related to the table component. Scrolling down, we'll see the data property. The data property holds all the data that the table is going to display. If we click on the binding icon, next to the data property, will be displayed a binding types window. This shows all the different binding types that are available for this data property. We're going to be concerning ourselves with the database ones, in this section right here. The DB Browse binding provides a simple mechanism for building a SQL Query. I already have a few tables in my database, so if I select the inventory table from the list, you'll get a preview of all the information that's going to come back from this query. Now, I want to bring back all the data from my table, so what I'm going to do is drill down and remove the key column selection right here. This key column is a way to add where clauses to your queries, in case you want to filter your data coming back as you query it. I'll select the inventory table again. And if we move over to the SQL Query binding, we'll be presented with the SQL Query editor. This shows us the query that was generated from our DB Browse binding. You don't need to use the DB Browse binding in order to generate your queries. You can simply write any SELECT Query you want here. And then once you're satisfied with the query, you need to pay attention to some of these other options down here. The Database Connection tells you which database source that your query is going to run against. Polling Mode - this refers to whether or not the query is going to run over and over at a certain rate, or if it's just going to run once, when the window opens, or any of the related properties that you may reference in here, change. Off means it's going to run once. When the window opens, or when any of the reference properties change. Relative means it's going to run relative to the base rig of the project. By default, this is five seconds. But that can be altered in the project properties. Absolute means it's going to, it's going to pull at a fixed rate. Once you have all these set to your, to how you'd like them, you go ahead and click "OK," and you'll see the, all the information that was brought back from that database query.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.

close

Share this video