RDOHELP72.HLB  —  DEFINE_RELATION, Format  field-def
    The name of a field that is part of the set of generic field
    definitions for the database.

  (B)0field-def=
  qwq> global-field-name qqqqqqqqqqwqwwqqqqqqqqqq>qqqqqqqqqqqqqqqwqwq>
   tq> global-field-def qqqqqqqqqqqu xmq> field-constraint-def  qu x
   tq> local-based-on-def qqqqqqqqqj mqqqqqqqqqqqqqqqqqqqqqqqqqqqj x
   mq> local-computed-by-def qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

    You can use a field name in any one of three ways in the DEFINE
    RELATION statement:

    o  Refer to an existing global field by name. This includes the
       global definition in the relation.

    o  Refer to a new global field name and include a complete
       definition, including a DATATYPE clause. This includes the
       field definition in the relation and also enters the field
       definition in the global set of definitions for the database.

    o  Refer to an existing global field in a BASED ON clause. This
       causes the field to have a local name and a global definition.

1  –  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.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.

1.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.

1.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.

1.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.

1.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.

1.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.

1.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.

1.8  –  conditional-expression

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

1.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