question

Roger W avatar image
0 Likes"
Roger W asked Ben Wilson edited

syncing labels or tables with database

I would like to know if it is possible to make a global table or label display values from database without event trigger to update. basically the table or label would be in sync with the database cell and purely displays the value from the database.

Thanks

FlexSim 17.2.2
labeldatabasetablesynchronizemysql
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Ben Wilson avatar image
0 Likes"
Ben Wilson answered Ben Wilson edited

@Roger W,

This answer at Stack Overflow suggests some methods that will allow you to watch for changes to a MySQL database. There are also other workarounds suggested on that page, but the basic gist is that MySQL doesn't offer an easy, out-of-the-box method for calling external functionality when changes happen in a database.

Assuming you can get one of the linked methods to work for you, such that some utility of your own making can sense when MySQL data has changed, that sensing utility could then send a message to FlexSim using sockets.

Anyway, there is no simple way to do what you'd like to do. It will take some effort.

If you switched to another database (Oracle, Microsoft, PostGreSQL, etc), there is a chance that better options might be available - though I have not researched these and don't know that for sure. Here is an example of connecting directly to Oracle using a DLL. Something like that might allow for an easier time accomplishing your goal, though I really don't know. Any solution that keeps your FlexSim data in sync with your database is going to require some research, creativity, and custom coding.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.