question

Joerg Vogel avatar image
0 Likes"
Joerg Vogel asked Jordan Johnson answered

A query containing a space character in an alias the result is No Data

If I run a model containing a space character in an alias of a Table.query, I get a Flexscript exception. If I delete the space character, on the next run shows the cloned table only cells containing No Data. I have to save the file without the error, close Flexsim completely and open the model again to get results with valid data.

To reproduce this behavior, please open the model and run it. The query clause contains already the error. You get the exception error at the time stamp 300. Then erase the error by deleting the space character and let run the model again. The Table "Result2" contains cells stating No Data by the red corners.

I bring this to the front again, because the Problem still exists in Flexsim 18.0.2. I have attached an enhanced model, which has got a description, what to do to get a result in the Table "Result2" with valid data. query-table-with-alias-space-character-faulty.fsm.

FlexSim 18.0.2
FlexSim 17.2.5
bugno dataquery aliasalias with space characters
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

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered

SQL syntax does not support spaces in the alias name, unless you put the name in brackets. So you can put the name in brackets:

SELECT $2 AS Obj, $3 AS Class, $4 AS Age, $5 AS [Type de] FROM $1

The bug is that once you try to run that bad query, some internal state of ours gets messed up. We should fix that. To get around this, fix the query, then close and reopen FlexSim. The new query runs fine.

5 |100000

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