question

Guldberg avatar image
0 Likes"
Guldberg asked Jeanette F commented

Querying list partition

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?


FlexSim 23.2.1
sqlglobal list
1697716299841.png (6.1 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

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

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

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")); 
5 |100000

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

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.