question

Jacob E2 avatar image
0 Likes"
Jacob E2 asked Jacob E2 commented

Use Global Variable in DBC Import Query

Hello, I am trying to find a way to utilize a global variable in the WHERE statement of the import query of my database connector. The intention is to use an Edit Text Box linked to the global variable that will be used to update the query. I want to do this so that the end user can update the query parameters frequently without having to learn FlexSim and SQL.

Example is shown in the picture below. I have tried enclosing the GV in {} as recommended here: Global variable in Query. However, that did not work for me either. Can this be done, or is there a workaround?

dbc-globalvariable.pngdbc-errors.png

FlexSim 23.2.0
sql querydatabase connector
dbc-errors.png (15.5 KiB)
· 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.

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jacob E2 commented

For this you should create your own import script and use a preparedStatement to then set your parameters to the global variable value.

· 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.