How Can I Over-Write an Existing Value in a Database Table from LabVIEW?
Primary Software Version: 1.0.1
Primary Software Fixed Version: N/A
Secondary Software: N/A
I am using the Database Connectivity Toolset in LabVIEW to manipulate data in a Database. I want to update a single value in my database table, but the DB Tools Insert Data VI seems to only insert new data. How can I update an existing cell value?
Appendix A of the Database Connectivity Toolset User Manual briefly lists and explains the use of common SQL commands, operators, and functions available for databases. One of the available commands is UPDATE. UPDATE is used to set columns in existing rows to new values. To run a Query using the Database Connectivity Toolset VIs, you will use the DB Tools Execute Query and DB Tools Free Object VIs from the Advanced Sub-Palette of the Database Connectivity Toolset Palette. See the attached SQLQuery image for how to use them.
The format of the UPDATE query is:
Note that every place in the column named Value with a value of 10 will be changed to 12. To limit the update by adding more qualifications, the format is:
You can add more qualifications by using the AND statement repeatedly. To update a non-numeric entry, the values will have to be surrounded by a single quote. For example,
Product Manuals: Database Connectivity Toolset User Manual
Report Date: 11/17/2003
Last Updated: 02/08/2010
Document ID: 33GD8L59