Hello, new to this forum and to ignition but learning my way around. Need advice on or guidance to documentation to accomplish the following:
I have a SQL table called recipenames and three other tables recipe1, recipe2, and sample. the last 3 tables have the same structure. I have a dropdown component with a SQL query binding that allows me to select values stored in recipenames, these are the names of the other tables.
I have a table component that uses a SQL query binding to display data based on the {Root Container.Dropdown.selectedStringValue} making it a dynamic table based on this property.
I would like to move the data from the table that is currently referenced in the {Root Container.Dropdown.selectedStringValue} property into a table called sample.
I figure i need to execute two SQL queries 1)clear the old data from sample table 2)populate sample table with new data
to clear the sample table, I want to execute SQL query
DELETE FROM sample WHERE id IS NOT NULL
to copy the data, I want to execute SQL query:
INSERT INTO sample (ID, ItemNumber, ProductName, Setpoint)
SELECT ID, ItemNumber, ProductName, Setpoint FROM {Root Container.Dropdown.selectedStringValue}
My questions are what mechanism can i use to execute those two SQL queries based off a Boolean status change trigger? I figure it's a tag change gateway event, but I don't know python so I am lost in that part of the designer.
second question is would I still be able to replace the source table name with the property value path I used to populate the table component? I tried doing so in the database query browser tool as this is where I was trying to work out the queries to clear and copy data but got an error when executing.
Thank you,
Ric L.