Querying list partition

Querying list partition

guldbergdk
Not applicable
42 Views
2 Replies
Message 1 of 3

Querying list partition

guldbergdk
Not applicable

[ FlexSim 23.2.1 ]

Im trying to count the number of rows in a partion where a label is a certain value, but my query doesnt work for some reason

List cranework = List("CraneWork");
Table result = Table.query("SELECT * FROM cranework.$1",01); 
result.cloneTo(Table("QueryDump")); 

I tried hardcoded .01 and putting "01" but no luck the query only kicks up an error

exception: FlexScript exception: No resolved tables at MODEL:/Tools/ProcessFlow/CraneControlPF/Custom Code>variables/codeNode


Its a partitioned global list looking like this

1697716299841.png


Am I missing something?


0 Likes
Accepted solutions (1)
43 Views
2 Replies
Replies (2)
Message 2 of 3

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

List names are case sensitive - you can't use 'cranework' for 'CraneWork' like you have as a local variable.

Correct syntax:

Table result = Table.query("SELECT * FROM CraneWork.$1","01"); 
result.cloneTo(Table("QueryDump")); 
0 Likes
Message 3 of 3

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Guldberg, 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 comment back to reopen your question.

0 Likes