Query Limit ?

779
5
10-27-2010 10:08 AM
Drew
by
Occasional Contributor III
Hello,
I am doing a large query and the esri js api is crashing on me..

I have tested my where clause in ArcMap and it works but its not working in the JS API because of its size / length (i believe)

Below is a dump of my where clause
SWISPIN IN ('18388911.-1-53.12','1824003.-1-99','18200012.-1-35.21','1824005.-1-53.2','1824005.-1-3','18348912.-1-51','18348912.-1-59.2','18348911.-1-23.2','1824005.-1-24','18240016.-1-8','FLAG','18388911.-1-36.11','18388910.-1-7.1','1824004.-1-10','FLAG','18240016.-1-21.1','1824003.-1-99','18240016.-1-23','1824003.-1-16.2','1824004.-1-23.2','1824001.-1-10.112','1824001.-1-10.12','FLAG','18428925.-1-28.2','1824004.-1-3.12','18240020.-1-98.21','1844002.-2-16.12','FLAG','FLAG','1824005.-1-6','1824005.-1-39.2','1824005.-1-13','1824003.-1-22','1824003.-1-128','1824002.-1-38','1824003.-1-100','1842899.17-1-3','1844001.-1-51','FLAG','18348910.-1-28.113','FLAG','18240013.-1-113.2','1824003.-1-6.2','1842898.-1-45','FLAG','1824005.-1-11.12','1824006.-1-60.2','1824004.-1-35','1832893.-1-13','1844001.-1-35','1824005.-1-144','18268915.-1-13.12','1842899.17-1-15','1838898.-1-8.12','18240014.-1-39','FLAG','FLAG','1824003.-1-110','1824001.-1-10.211','18348910.-1-24.2','1824005.-1-37','1824005.-1-52.2','18240016.-1-2','1824004.-1-9','18348912.-1-45','FLAG','1824005.-1-29.1','FLAG','1824004.-1-1.11','1824004.-1-11','FLAG','1824004.-1-19.1','1824005.-1-135','FLAG','1824005.-1-42.2','18348912.-1-65.1','FLAG','18440010.-1-9.111','18240017.-1-22','18240017.-1-16.121','1824006.-1-62.2','1824007.-1-94','1824003.-1-24','1824004.-1-27.2','1824005.-1-20','FLAG','18348910.-1-24.1','FLAG','18240020.-1-16','18348912.-1-66.111','18428925.-1-7','1824003.-1-109.1','1824005.-1-135','1844006.-1-19.2','1824003.-1-101','1824003.-1-101','18348912.-1-50.2','FLAG','18348911.-1-23.1','18240020.-2-51','18240020.-2-55.12','18348911.-1-22','1824004.-1-7','18368919.-1-22.2','18388911.-1-49.12','18240014.-1-40.1','18240017.-1-16.121','1824005.-1-22.1','1824005.-1-36.12','1844001.-1-49','1824006.-1-60.1','1824003.-1-16.1','1826896.-1-59','1824003.-1-109.2','18348910.-1-15.2','18240019.-1-42','FLAG','FLAG','1824005.-1-36.2','1824005.-1-36.114','1844001.-1-40','1824003.-1-129','18428925.-1-28.2','1824004.-1-20.1','FLAG','FLAG','1824002.-1-29.1','1824005.-1-2','FLAG','1824005.-1-9.12','1824002.-1-34','1824003.-1-25.1','FLAG','1824003.-1-93','18348912.-1-59.112','1824005.-1-52.12','1844001.-1-50','18348912.-1-52','1824005.-1-29.2','18348911.-1-21','1824006.-1-8','1824005.-1-137','1824003.-1-27','18440012.-1-25.1','1824005.-1-12.1','18200012.-1-48','18240016.-1-19.2','1842898.-1-52','FLAG','FLAG','1824004.-1-36','1824006.-1-12.2','1824006.-1-56','FLAG','1824002.-1-37','1824003.-1-102','1824005.-1-17.2','1824002.-1-28.2','18388910.-1-5.1','1824003.-1-15','18388911.-1-50.2','18348911.-1-17','18348910.-1-23','18368931.-1-108.12')


Yes its long, but its really only 165 properties.

According to Firebug and my own debugging the query is not even being sent to the server, it dies on execute() but works when I use a small length where clause.
Right now i get a "Type error: io is undefined" error from the ESRI JS file.

Is there a limit on the where clause length?

Drew
0 Kudos
5 Replies
derekswingley1
Frequent Contributor
Since your query gets tacked on to the URL, and browsers impose a limit on the size of URLs for security purposes, you'll need to configure a proxy page to get this to run successfully. More info here:  Using the proxy page. The first bullet point on that page addresses your issue.
0 Kudos
Drew
by
Occasional Contributor III
Since your query gets tacked on to the URL, and browsers impose a limit on the size of URLs for security purposes, you'll need to configure a proxy page to get this to run successfully. More info here:  Using the proxy page. The first bullet point on that page addresses your issue.


I thought the same thing but when i test the Query through the ArcGIS Services Directory Query form it works and its all placed in the URL.
0 Kudos
Drew
by
Occasional Contributor III
After a little further reading your probably right and the JS API is restricting the call..
I will look at the proxy page you mentioned or just move to the SOAP API for my specific task.

Thanks for your assistance Derek .

Drew
0 Kudos
MichaelRollins
New Contributor
You're most likely running into the get size limit.  You're where clause is being written as a param in the call, so it's probably blowing up the url, passing in a partial where.  Can't remember what the size is off the top of my head, but it's around a couple thousand.  If you can force the call to switch to post you'll clear that limit. 

Of course, I don't know of a way to specify in the JSAPI query class how to switch to post, or if it does it automatically, but I would recommend sticking with the RESTful services, they're much easier to work with in general.
0 Kudos
Drew
by
Occasional Contributor III
You're most likely running into the get size limit.  You're where clause is being written as a param in the call, so it's probably blowing up the url, passing in a partial where.  Can't remember what the size is off the top of my head, but it's around a couple thousand.  If you can force the call to switch to post you'll clear that limit. 

Of course, I don't know of a way to specify in the JSAPI query class how to switch to post, or if it does it automatically, but I would recommend sticking with the RESTful services, they're much easier to work with in general.


It was the URL and i used the proxy page  swingley linked above.
It worked perfect.

Thanks guys,

Drew
0 Kudos