I wrote a program to import data into a MySQL table every second.
How can I write some custom code to read from MySQL and update the global table every second.
I wrote a program to import data into a MySQL table every second.
How can I write some custom code to read from MySQL and update the global table every second.
First, set up a connection to your database in the "Database Connector" (found under "Connectivity" in the toolbox).
Then you can use the "Database" class and it's methods to read or write values from/to the database.
The attached model contains an example we build for a client some time ago (v18.2) that contains some code which adds a new row to the database. To read from it you would use the standard "SELECT ... FROM ... " sql query structure.
The code can be part of a custom code activity in process flow, so a token can loop through a delay activity and run the code periodically.
Hi!
After creating and a DatabaseConnector, you can use this command inside a loop in Process Flow:
function_s(model().find("Tools/DatabaseConnectors/DBConnector1"), "importAll");
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved