No records returned when using the WHERE attribute in the SPATIALQUERY or QUERY ArcXML tags


No records are returned when querying a shapefile using the WHERE attribute imbedded in the SPATIALQUERY or QUERY XML tags.

For example:

<?xml version="1.0"?>
<ARCXML version="1.0">
<GET_FEATURES outputmode="xml" geometry="false" envelope="false" compact="true">
<LAYER id="0" />
<QUERY subfields="#ALL#" where="sfield='Value 1'">

ArcXML Response:

<?xml version="1.0"?>
<ARCXML version="1.0">
<FEATURECOUNT count="0" hasmore="false" />


The Spatial Server is unable to process the query because either the shapefile attribute table does not contain an ID field, or the shapefile has an ID field but it is not populated with numeric values.

Solution or Workaround

Make sure the shapefile attribute table contains a number field with the name ID and that the field is populated with unique numeric values. Refer to the article in the Related Information section below for instructions on how to create a new number field and populate it with unique values.

Refresh the MapService after editing the shapefile.

Article ID:000002412

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic