question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Mischa Spelt commented

Queries not working when accessing labels on labels

Lists and resources seem to have a problem when the pull or acquire query access a label on a label using dot syntax. In the attached model I am creating items in a queue and in the pull action on the top I am trying to find a token for which the token's item has a Product with a particular value. The pull throws an "Invalid SQL Query" error and breaks.

The second option, using the old-fashioned getlabel syntax, does work.

Is this supposed to happen?

FlexSim 17.0.0
labelsquerybug reportlistsdot syntax
5 |100000

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

Matt Long avatar image
1 Like"
Matt Long answered Mischa Spelt commented

Unfortunately queries are parsed using our SQL parser which is a completely different parser than the compiler uses for FlexScript. We made the SQL parser work with a single label accessor, but adding functionality for multiple label accessors is not trivial. At some point we would like to add this in. We'll add this to the dev list.

· 4
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

@Matt Long What happens then in the statement I posted? puller.Product = value.Producte

0 Likes 0 ·
Matt Long avatar image Matt Long Joerg Vogel commented ·

That works just fine because you're using a single label accessor on puller and value. Where you would run into issues was if you said puller.Product.serial = value.Producte.serial

1 Like 1 ·
Joerg Vogel avatar image Joerg Vogel Matt Long commented ·

@Matt Long

Thanks for the answer. Regards Jörg

0 Likes 0 ·
Mischa Spelt avatar image Mischa Spelt commented ·

Thanks for both the reply, and considering this for a future release. One of the reasons I love the dot notation is because I got a bit tired (and confused) with writing getlabel(getlabel(...)) :-)

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

@Mischa Spelt

Maybe you should use unique names for your labels. If you do so, then the condition

puller.Product = value.Producte

seems to work.

I added to the label name "Product" simply the letter "e".

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

Joerg Vogel avatar image Joerg Vogel commented ·

Here ist the file.

0 Likes 0 ·