RDOHELP72.HLB  —  DEFINE_RELATION, Format  field-def  field-constraint-def
    Using the field-constraint-def clause you can name or specify the
    type of field-level constraints to be defined within a specific
    relation definition.

  (B)0field-constraint-def =
  qwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk
   mq> CONSTRAINT constraint-name IS qqj x
  lqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqj
  mwq> NOT MISSING qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwqk
   tq> UNIQUE qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x
   tq> PRIMARY KEY qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x
   mw> REFERENCES referenced-relation-name qwqqqqqqqqqqqqqqqqqqqqqqqqwu x
    x                                       m> referenced-field-name jx x
    x                                                                 x x
    mq> USING rse REQUIRE conditional-expr qqqqqqqqqqqq>qqqqqqqqqqqqqqj x
                                                                        x
  lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq<qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
  mwqqqqqqqqqqqqqqqqqqqqqqqqqqqwq>
   mqq> CHECK ON qwqq> COMMIT qu
                  mqq> UPDATE qj

1  –  constraint-name

    The name of a field constraint associated with the relation that
    is being defined. This name must be unique within the database.
    The constraint name can be referred to in other statements such
    as CHANGE RELATION, SHOW CONSTRAINT, and START_TRANSACTION.

    The clause 'CONSTRAINT constraint-name IS' is optional. If you
    do not specify the keyword CONSTRAINT, Oracle Rdb provides a name
    for the constraint. However, Rdb recommends that you always
    name field and relation constraints. The alternative is to have
    constraints named by the database system with names such as
    LAST_NAME_REQUIRE_0001.

2  –  NOT_MISSING

    Restricts field values such that none of the values for the
    specified field can assume either the defined or default missing
    value for that field. You can only explicitly declare the NOT
    MISSING clause at the field level.

3  –  UNIQUE

    This clause names a field in the relation which is a part of
    a unique key. This field name can appear only once in the key
    definition.

    The UNIQUE clause limits field values such that no two rows in
    the associated relation can have the same non-missing values for
    the specified field or fields.

4  –  PRIMARY

    This clause names a field in the relation which is a part of a
    primary key. This field name can appear only once in the base
    relation. Oracle Rdb requires that the values in a primary key
    be unique and not missing; therefore, you need not specify the
    UNIQUE and NOT MISSING field constraints for a field that you
    designate a primary key. Only one primary key can be declared for
    a relation.

5  –  referenced-relation-name

    The name of the relation that defines the unique or primary
    key definition which is referred to by a foreign key of this
    relation. If there are no referenced-field-names specified with
    this relation-name, then the referenced-relation must have an
    associated constraint which specifies a primary key. If there
    are referenced-field-names, the referenced-relation must have a
    unique or primary key constraint defined which specifies a list
    of unique-field-names. These names have to be the same names as
    in the referenced-relation.

6  –  referenced-field-name

    Specifies the name of a field in the foreign key relation that
    corresponds to the field with the same ordinal position within
    the list of fields referred to by the primary key relation.

7  –  rse

    A record selection expression that defines which records of which
    relations will be tested against the conditional expression. This
    rse cannot refer to any host variables.

8  –  conditional-expression

    An expression that describes the optional conditions that must be
    satisfied before the record can be stored in the database.

9  –  CHECK

    Declares the time when the constraint is evaluated. The
    referential constraint can be evaluated when the update occurs
    (CHECK ON UPDATE) or when a COMMIT is issued (CHECK ON COMMIT).
    The EVALUATING clause of the START_TRANSACTION statement can
    override the CHECK ON clause.
Close Help