Perspective Manual Data Entry to SQL?

I’m trying to create a data entry page for operation to capture data points that are not collected in the PLC, things like planned downtime, scrap, etc.

What is the most efficient way of writing property values (text boxes and label values) to a SQL table along with tag values?

I can write the stored procedure to handle the DB side, but not sure on the ignition/scripting side.

image

Thank you!

On your “Write this data to SQL” button I would make an ‘onActionPerformed’ script that gathers all the data, like a list or dictionary, or some combination. Use something like:

SQL['scrapReels']['value'] = self.getSibling("Scrap Reels Input Component").props.text

to get the data from each component. To use a stored procedure, if that particular flavor is supported, you’ll also need to send an index and “system.db.” with each parameter.

https://docs.inductiveautomation.com/display/DOC80/SQL+Stored+Procedures#SQLStoredProcedures-StoredProceduresinPythonScripts

I apologize if all that is too vague, the question itself is pretty broad. I will be happy to clarify any point(s), though, just ask :slight_smile:

1 Like