Parent Topic: Attribute Editing and Querying
Query Expression Grammar
Query expressions must follow the grammar structure of EXPR, which is defined below. There is no limit to the length of a query expression.

         EXPR:   PRIMARY
                 unary_op (EXPR)
                 (EXPR) binary_op (EXPR)

      PRIMARY:   field OP value

           op:   =
                 <
                 >
                 <=
                 >=
                 <>

     unary_op:   not

    binary_op:   and
                 or
In the above grammar definition, "field" represents a field name and "value" represents a field value. Query expressions are always case insensitive. This applies to attribute field names as well as string fields.

For example, the following query expressions are equivalent:

 CROPTYPE = WHEAT
 croptype = wheat
 CropType = Wheat
 Croptype = WHEAT
The field name does not have to be specified in full. That is, pattern matching is performed for the field names. However, this pattern matching only works when the first letter or letters of the field name are given. If a pattern is given but it does not uniquely identify one field name (it matches more than one field name), then the first field matching the pattern is used in the query.

For example, if the current layer has one field called "CropType", then query expressions (1) and (2) would be valid while (3) would not be because of the pattern-matching rules. Query expression (1) and (2) would produce the same results if applied to the same set of shapes.

 (1) CropType = wheat
 (2) Crop = wheat
 (3) Type = wheat
If a field name contains non-alphanumeric characters, then it must be enclosed in double quotes. For example:

 "Crop_Type" = wheat
 "Crop Area" > 3000
If a value contains non-alphanumeric characters, it must also be enclosed in double quotes. For example:

 LOCATION <> "ORANGE COUNTY"

Parent Topic: Attribute Editing and Querying
About PCI Help Gateway