question

Yokota T avatar image
2 Likes"
Yokota T asked Ryan Clark commented

Export global table with symbol-characters to database

Hi all,

I'm trying to export my global table to the database(MySQL). But the exporting fails.

My guess is that because the column name has symbol-characters. I experimented on exporting. When I used ',' or '(', it failed. But when I used '$' or '_', it succeeded.

What characters can I use in the column name?

Thanks.

FlexSim 21.0.6
databaseexportexport datadata export
· 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.

John-Michael avatar image John-Michael commented ·

Thank you for your question!

To help us in providing a clearer answer, could you send us a copy of your model?


0 Likes 0 ·
Yokota T avatar image Yokota T John-Michael commented ·

Here is my model.

Export_to_MySQL.fsm

In GlobalTable1, I can export only "Time" column.

In GlobalTable2, I can export only "$" column.

0 Likes 0 ·
export-to-mysql.fsm (98.8 KiB)
Ryan Clark avatar image Ryan Clark commented ·

Hi @Yokota T, was Jordan Johnson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered

In the database export tool, try wrapping your flexsim column names in square brackets:

1644014443644.png

To export to the database, we currently run a query in FlexSim to create the table that will be exported. Basically, this tool writes the following code:

Table toExport = Table.query("SELECT [#], [!], [)] FROM GlobalTable2");
// Then we iterate through the rows of toExport, sending them to the target table

So the "From FlexSim Column" values may need to be wrapped in [].


1644014443644.png (24.2 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.