I have a javascript application that sets a definition expression to a map service layer based on user-defined criteria. There are instances where this expression can be very lengthy (for instance, one problematic expression is 24,000 characters).
Is there a limit to how long a definition expression can be?
Do (will) definition expressions use a proxy service?
Thanks,
Andrew
Solved! Go to Solution.
Andrew,
Wow a 24,000 character definition expression... Are you using a ton of AND or ORs in the SQL? If so you should try using IN instead. The limitation is not a hard set limitation and varies on the underlying Database used. A Google search will reveal several results and nothin with a specific limit, just general advice to reconsider your workflow if your query is that large, (like consider an inverse of the SQL statement).
Andrew,
Wow a 24,000 character definition expression... Are you using a ton of AND or ORs in the SQL? If so you should try using IN instead. The limitation is not a hard set limitation and varies on the underlying Database used. A Google search will reveal several results and nothin with a specific limit, just general advice to reconsider your workflow if your query is that large, (like consider an inverse of the SQL statement).
Yes, it's a ton of "OR"'s. I considered doing an inverse query but I think that might be just as bad. (these are statewide sampling locations so there are A LOT of them. I will try using an "IN" statement and see if that works.
It is far more efficient than a ton of Ors.