QUERY  Examples

Used in:  CONFIG   REQUEST   RESPONSE  
Servers:  Image   Query   Feature   Extract   ArcMap  
Parent elements:  GET_FEATURES   LAYER   LAYERDEF   STOREDQUERY  

<QUERY Attribute Description Table


     When using ArcMap Server:
     where ="string"
     featurelimit ="integer"  [All that meet criteria]
     subfields ="#ALL# | #ID# | #SHAPE# | Other fields in database"  [#ALL#]

     When using Image, Extract, Query, or Feature Server:
     where ="string"
     accuracy ="Distance between points"  [0]
     featurelimit ="integer"  [All that meet criteria]
     joinexpression ="string"
     jointables ="string"
     subfields ="#ALL# | #ID# | #SHAPE# | Other fields in database"  [#ALL#]
>


     When parent element is GET_FEATURES:
     <BUFFER... />
     <FEATURECOORDSYS... />

     When parent element is LAYER and LAYERDEF in GET_IMAGE:
     <BUFFER... />

</QUERY >
Bold: Attribute or child element is required.


Description:


Restrictions:


Notes:


Attribute Descriptions for QUERY:

Attribute Usage Back to Top
accuracy Within a feature, generalizes points based on the distance specified and the resolution of the image.
featurelimit Maximum number of features to be extracted that meet criteria.
joinexpression Used for join tables with DBF files only; jointables must be filled to contain list of tables used; not required when a jointable is done on ArcSDE.

String must form expression: "To=[master table column which will be used for joining], From=[defines a join table column which will be joined], Type=[exact or scan]".
jointables List of joined table names separated by blank spaces; for ArcSDE, table name is full name including database name (e.g., DATA.STATE); for shapefiles, names of DBF files without extension (e.g., STATES).
subfields List of fields to be extracted separated by blank space. In stored queries, all fields in the layer table must be included.
where Defines 'where' part of SQL expression. Required when jointables attribute for ArcSDE tables is used.
 

Examples for QUERY:

Example 1: When in a map configuration file using a STOREDQUERY. For additional examples on querying datasets in map configuration files and requests, see SPATIALQUERY. Back to Top
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <CONFIG>
    <ENVIRONMENT>
      <LOCALE country="US" language="en" variant="" />
      <UIFONT color="0,0,0" name="Arial" size="12" style="regular" />
      <SCREEN dpi="96" />
    </ENVIRONMENT>
    <MAP>
      <PROPERTIES>
        <ENVELOPE minx="-178.21" miny="18.92" maxx="-66.96" maxy="71.41" name="Initial_Extent" />
        <MAPUNITS units="decimal_degrees" />
      </PROPERTIES>
      <WORKSPACES>
        <SHAPEWORKSPACE name="shp_ws-0" directory="<path to USA ESRIDATA>"/>
      </WORKSPACES>
      <LAYER type="featureclass" name="CITIES" visible="true" id="2">
      <DATASET name="CITIES" type="point" workspace="shp_ws-0" />
      <SIMPLERENDERER>
        <SIMPLEMARKERSYMBOL type="square" width="5" />
      </SIMPLERENDERER>
        <EXTENSION type="StoredQuery">
        <STOREDQUERIES>
          <STOREDQUERY name="TestSt">
            <QUERY where=" ZIPL  =  &apos;[%var%]&apos; " subfields="#SHAPE# FNODE_ TNODE_ LPOLY_ RPOLY_ LENGTH RECNUM L_F_ADD L_T_ADD R_F_ADD R_T_ADD PREFIX NAME TYPE SUFFIX CFCC ZIPL ZIPR"/>
            <SQVAR position="0" name="[%var%]">
              <FIELD name="ZIPL" precision="0" type="12" size="5" />
            </SQVAR>
          </STOREDQUERY>
        </STOREDQUERIES>
        </EXTENSION>
      </LAYER>
    </MAP>
  </CONFIG>
</ARCXML>