question

Urvi Sukharamwala avatar image
0 Likes"
Urvi Sukharamwala asked Jason Lightfoot edited

Database - export data

1706543226974.pngI have this example model can you please help me with exporting data on run stop trigger. What should be the flexscript?

FlexSim 24.0.1
export datasql serverdatabases
1706543226974.png (79.8 KiB)
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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jason Lightfoot edited

You can either trigger the export of all defined exports like this:

  1. Object dbConnector=Model.find("Tools/DatabaseConnectors/DatabaseConnector1");
  2. function_s(dbConnector,"exportAll");

Or trigger a single export:

  1. Object dbConnector=Model.find("Tools/DatabaseConnectors/DatabaseConnector1");
  2. treenode dbexport=variables(dbConnector).subnodes["exporters"].first;   // the first in the list of exports.
  3. function_s(dbConnector,"exportSingle",dbexport);

Since it uses function_s calls, you may need to revise this code in the future, so if you need to invoke it in many places I'd place it in a user command and call that from multiple places instead.

· 4
5 |100000

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