question

Axel Kohonen avatar image
1 Like"
Axel Kohonen asked Axel Kohonen commented

Limit on the SQL query length?

Hi,

I have a model with complicated queries so the query length is around 1300 characters. If fits nicely in a string, but the queries behave weirdly so I am wondering if there is some limit to the length of the query string in the SQL? At least when viewing the back orders I cannot see the entire string.

Any clue on this?

Kind regards,

Axel

FlexSim 17.1.4
querysqllimit
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

·
anthony.johnson avatar image
3 Likes"
anthony.johnson answered Axel Kohonen commented

Axel,

I looked at the source code, and there's a limit of 2000 sql "instructions" in a single sql expression (the predicate of a WHERE would for example be a single expression). Operators and operands generally take up one instructions each (for instance "Col1 + Col2" would take up 3 instructions).

As far as I could tell there wasn't a limit on query string size. Could you put it into a model we can look at?

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

Axel Kohonen avatar image Axel Kohonen commented ·

HI @anthony.johnson

Thank you for the answer! I finally got the model to work when I figured out a way to debug the pulling from the list by using using list.pull from the script window without removing from the list, i.e.

List test = List("List1");
Array result = test.pull(queryStr,0, 0, current,0,LIST_DO_NOT_REMOVE);

So I guess there was no problem with the length of the string, but only with how to debug the list pulling.

Thank you!

Axel

0 Likes 0 ·

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.