RDOHELP72.HLB  —  DEFINE_CONSTRAINT, Example
    Check for the existence of a field value in another relation:

    DEFINE CONSTRAINT DEPT_CODE_EXISTS
      FOR JH IN JOB_HISTORY
        REQUIRE ANY D IN DEPARTMENTS WITH
        D.DEPARTMENT_CODE = JH.DEPARTMENT_CODE.

    The ANY operator is equivalent to saying "there exists". This
    constraint therefore means "For every record in JOB_HISTORY,
    require that there exists a record in DEPARTMENTS where the
    DEPARTMENT_CODE values match."
Close Help