question

Gerald avatar image
1 Like"
Gerald asked Borja Lorenzo edited

No options available for database table to export to.

I am attempting to push a global table to a Microsoft SQL studio database using a successfully connected Database connector. I use Flexscript to push the table at the end of the simulation, but I have realized I should be able to set this up using the connector only and the export tab. However, the list shows no options when attempting to set up the table that will be pushed to the database. It suggests testing the connection, which I have done successfully, but no table options are showing up. Any help will be greatly appreciated.

FlexSim 22.2.0
databasedatabase connector
· 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.

Kavika F avatar image Kavika F ♦ commented ·

Hey @Gerald, from what I understand, you were able to successfully connect your SQL Database to FlexSim; however, you can't see any Global Tables in the export tab? What happens when you go to the Database Connector > Export tab and click the Green + button to add a Global Table? Do any show up?

1687801326860.png

0 Likes 0 ·
1687801326860.png (39.6 KiB)
Julie Weller avatar image Julie Weller commented ·

Hi @Gerald,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered Borja Lorenzo edited

Based on the code found in the library:

MAIN:/project/library/DatabaseConnector>behaviour/includebody, L165

It looks like we only generate the list of possible tables for MySQL, Oracle, SQLite, and PostgreSQL. It looks also like there's a default query that it tries, if the connection is other than one of those types. So it's very possible that the queries that generate the list of tables/columns for that button aren't correct given your connection type.

However, if you already generated the query you need, you can just use that query in the export tab. The list of tables/columns is not required for a successful connection.

· 3
5 |100000

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

Borja Lorenzo avatar image Borja Lorenzo commented ·

Hello @Jordan Johnson

The same thing happens to me with a MySQL Database version 8.0.26. As you can see in the image, it does not load the tables that I do have in the Database. The connectivity test is correct and the import works fine. The export with the command Database.Connection | .connect() | .query() executed from Script does confirm that there is a connection and I can write to the table with the query. The problem is that from the FlexSim Connection tool I cannot select the tables. What could be happening?

Thank you in advance.
export-from-flexsim-2.jpg

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Borja Lorenzo commented ·
That does seem like a bug, I'll add something to the dev list.
1 Like 1 ·
Borja Lorenzo avatar image Borja Lorenzo Jordan Johnson ♦♦ commented ·

Hello Jordan

Thank you very much for your response. I was going crazy. In this question that I have open, I have left more details: https://answers.flexsim.com/questions/171152/export-a-global-table-from-flexsim-to-badedate-mys.html.
Currently, I have resolved the export through the API, but the Export tool of the DBConnector is certainly more practical.


Again, thank you very much, and I will be attentive to any updates on this matter.

0 Likes 0 ·