Add Data to a Database
A common method of adding data to a database from within a client is using a Button component that executes an SQL query. This section provides an SQL script showing how to collect relevant properties and insert them into a database, as well as how to setup your components on a window.
Edit Data in a Database
Editing data in a database is very similar to how we add data to a database. Users can edit data within a table on the screen in realtime, and the changes are then pushed back to the database table. This section goes over the different ways to edit data in the database depending if you're using a Table component or Power Table component.
Refreshing SQL Data on a Component
Sometimes, it may be unnecessary to have a table constantly updating and requerying the database for data. By using the system.db.refresh function, we can turn Polling "Off" on our query, and have a button that allows us to manually update the table with new data when the Button is pressed. Alternatively, we can add the system.db.refresh function at the end of a script to refresh the newly entered data automatically without pressing a button.
Editing Multi-Selected Rows from Table
Tables have the ability to select and edit multiple rows at a time. Oftentimes, this can be used to manipulate multiple rows simultaneously, such as deleting all of the selected rows at once.
Storing PDF Files in a Database
The database is a powerful tool and can allow you to store files such as PDFs in a database table. The Storing PDF Files in a Database section explores how we can take a PDF file and store it in the database table, as well as how to pull it back out and display it in the Vision - PDF Viewer component.
Simple Database Editor
It may be beneficial to have a frontend to a database table built right into an Ignition project that allows you to control the data in the table without having to go into the database's built-in frontend, such as MySQL workbench. In the Simple Database Editor section, you will learn how to build a simple database table editor on a window that can add, edit, and delete data from the database.