URL Query Sql Expression directly to REST issue

649
4
01-05-2011 08:36 AM
by Anonymous User
Not applicable
Hope this is simple.  When I browse to my Server Service URL
http://gis.myserver.gov/ArcGIS/rest/services/Parcel_Layers/MapServer/50
and enter a "where" expression:

this works -
TAX_ID = '253-004' AND NOT TAX_ID = '253-005'

this does not work -
TAX_ID = '253-004' OR TAX_ID = '253-005'

It seems to understand "AND NOT" but doesn't understand "OR" - why?
I want to select two parcels at one time - with a valid sql expression.
Later I will pass this string from actionscript.  Thanks for any ideas.
Tags (2)
0 Kudos
4 Replies
KeithPalmer
New Contributor
Dan,

The OR should be working.  I did a Query (GET) with APN = '52-1446-6' OR APN = '52-1448-13' on my parcel layer and had two results returned.

Just as a test you might try the query in SQL Server Management Studio just to be sure it works there.

Wish I had an answer, but at least you know it should be working.

-Keith
0 Kudos
by Anonymous User
Not applicable
Thanks for taking a shot Keith.  It should work - but, doesn't!  Sql server queries are fine.
It's a simple rest query:

query.where = "TAX_ID = '253-004' OR TAX_ID = '253-005'";

The flex API documentation for the class where property states:
"Any legal SQL where clause operating on the fields in the layer is allowed."

Well, "OR" is legal - I'm stumped.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dan,

   You can always use the IN operator instead:

query.where = "TAX_ID IN ('253-004', '253-005')";
0 Kudos
by Anonymous User
Not applicable
Robert - you are good - thank you!

Dan,

   You can always use the IN operator instead:

query.where = "TAX_ID IN ('253-004', '253-005')";
0 Kudos