AnswerHub Upload Issue
Our AnswerHub community currently has a bug that prevents you from attaching your model or other files to your questions. AnswerHub is aware of this issue and they are working on a fix. Until we receive their patch, you can upload your models and other files to FlexSim's file share site. Include the file name in your question so that we know which upload to reference.

question

Carl C3 avatar image
0 Likes"
Carl C3 asked Carl C3 commented

Update specific fields of a global table

Hi Guys. I'm trying to Update two specific fields of a global table with a custom code. An item with a ProductNumber-label enters the process flow and I want to update some data of the exact product in a global table, where all existing products are stored, but I am not sure how to relate to the token label in the code. I attached the model and a screenshot of the problem.

I hope my problem is clear to you. Thanks for your help!

FlexSimquestion.jpgFlexSimQuestion.fsm

FlexSim 21.0.1
global tablesql
flexsimquestion.jpg (186.3 KiB)
flexsimquestion.fsm (31.3 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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Carl C3 commented

You can pass parameters into an sql query with the "$-syntax". Instead of the typing an actual value you write "$1" (, $2, $3, ...) and add the parameters to the command after the query, separated by commas ("Query", param1, param2, param3, ...). When the query is evaluated the value of param1 will be used in place of $1 and so on.

Also, values to be changed in the "SET" keyword are separated by comma, not "AND".

1641394424707.png


1641394424707.png (5.8 KiB)
· 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.

Thanks a lot, it worked!

0 Likes 0 ·

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.