question

MR avatar image
0 Likes"
MR asked Ryan Clark commented

Export Flexsim data to SQL

Hello everyone, I have let information of agv (e.t.c. traveling times a day or every load time) into global tables. And I want to export these data instantly to SQL. I have been looking for the answers on Flexsim doc and Flexsim community, but it all failed. Both of the coding on these two page will have system console. So, I want to know is there any other method to solve this question? Thank you so much.

FlexSim 20.0.10
sql
· 1
5 |100000

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

Ryan Clark avatar image Ryan Clark commented ·

Hi @Ingrid Hung, was Jason Lightfoot'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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

Which "two pages" are you referring to?

You connect to your Database using the database connection and prepare a statement with the INSERT INTO syntax required.

· 6
5 |100000

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

MR avatar image MR commented ·

Thanks for your reply.

Both Flexsim Doc and Flexsim Community.

Below is the code in Flexsim and system console will always appear.


1649096124065.png 1649096275119.png

0 Likes 0 ·
1649096124065.png (147.4 KiB)
1649096275119.png (195.7 KiB)
Joerg Vogel avatar image Joerg Vogel MR commented ·
I don’t have any knowledge to this case, but I think an assignment of Table agv should be completed before you prepare a statement that a compiler interprets as system code.
0 Likes 0 ·
MR avatar image MR Joerg Vogel commented ·
Thank you.
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ MR commented ·
Do you have a space in the table local variable between 'agv' and 'information' ? That would not be allowed.
0 Likes 0 ·
MR avatar image MR Jason Lightfoot ♦ commented ·

Thanks for your reply.

The following picture is the data table of MySQL.I hope my model global table to automatically send data to the database table immediately after running for a day (86400 seconds).

1649159257222.pngFlexsimSQL.fsm

0 Likes 0 ·
1649159257222.png (34.0 KiB)
flexsimsql.fsm (65.6 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ MR commented ·

This looks like a space between "agv" and "information" - that's not allowed.


1649264563254.png

0 Likes 0 ·
1649264563254.png (5.3 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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