To Add Constraints Using the Schema Editor

When you create a schema, you can limit the values that are valid for particular properties.

To create a constrained property

  1. In the Schema Editor, expand the Schema tree and select the property to constrain.
  2. Do one of the following:
    • To specify a range for the property, set Constraint Type to Range and specify the range values.

      In the Constraint Type field, click the down-arrow and click Range. Enter a minimum and maximum value for the range and, for each one, specify whether the range is inclusive or exclusive of that value. For example, if the range is 1-10, specify whether 1 and 10 are included or not.

    • To specify a list of possible values, set Constraint Type to List and specify the list values.

      In the Constraint Type field, click the down-arrow and click List. Click Value List and click . Type the list, pressing Enter after each item.

      If the data type for this property is String , specify the maximum length of the string before entering values in the list.

      If the data type for this property is Decimal , define the precision and scale before entering values in the list. If you enter values in the list that exceed the precision or scale, those values are rounded.

      If the data type for this property is DateTime, the list editor displays a calendar from which you can select specific dates. Once you choose the first date, the list creates a new entry and you can choose the next date.

      When you click OK, AutoCAD Map 3D checks the values in the list. If the values are not valid, for example, if they do not match the data type or they exceed the length of the string definition, you will see an error message.

    • To ensure that the property is not allowed to have an empty value, set Nullable to False.

      In the Nullable field, click the down-arrow and click True or False. If you set Nullable to False, you can enter a Default Value to ensure that new features have an entry for this property.

  3. To specify a “uniqueness” constraint, select the appropriate feature class in the tree on the left.

    You can specify a single-property uniqueness constraint or a composite-property uniqueness constraint. A single-property uniqueness constraint ensures that the value for that property is unique within the feature class. A composite-property uniqueness constraint (sometimes called a “paired constraint”) specifies multiple properties whose combined values are unique. For example, you can constrain the combined Street_Number, Street_Name, and City fields to uniquely identify a building address.

    • Click New (under Specify Constraints (And The Order)).
    • Select the boxes for the properties that must have unique values.

      The properties designated as unique appear in the list at the bottom of the dialog box.

    • If desired, use the up and down arrows for the list to change the order of the properties.
  4. Click Apply.