Defining a SQL statement
When you are creating calculated representation and calculated field rules, you must define the set of features to be symbolized or for which you are going to create fields.
An SQL SELECT statement allows you to define a set of features based on any attributes within a feature class or on relationships between the feature class and other feature classes or stand-alone tables. For example, if the name of a feature is related to a record in a stand-alone table, you can write a query that states that the feature should be included as the query result if the field value is equal to the table value. If you want to select features from a feature class such as BuoyP, where the feature name is equal to the value in a field within a stand-alone table, you would configure a statement similar to the following:
SELECT OBJECTID FROM BuoyP, PRODMAP_FREL WHERE LNAM=PRODMAP_FREL.SRCNAM
-
Right-click the layer for which you want to define a calculated specification rule and click Properties.
The Layer Properties dialog box appears.
- Click the Calculated Representations or Calculated Fields tab.
- If necessary, create a new representation and rule.
-
Click the SQL Statement drop-down arrow and click Edit SQL statement.
The Query Builder dialog box appears.
- Choose the layer field you want to use in the selection or WHERE clause.
- Click Add to SELECT if you want to be able to use the field value to later define a VBScript.
- Click Add to WHERE to use the field to determine your selection set.
-
Click All Values.
All the unique values for the field appear in the Values list.
- Choose one of the values in the Values list.
- Click Add to WHERE.
- Click one of the operator buttons.
- Repeat steps 5–11 until your statement is complete.
- Click Verify to validate the SQL statement.
-
Click OK.
提示:
You can clear the contents of the SELECT OBJECTID and WHERE areas by clicking Clear.