Library /sys$common/syshlp/RDOHELP72.HLB  —  MODIFY  More
    You need the Oracle Rdb READ and MODIFY privileges to the relation
    and also the Oracle Rdb MODIFY privilege to the database to use the
    MODIFY statement.

    Prior to Version 4.1, Oracle Rdb allowed you to modify rows in a
    table that was directly joined with other tables. Beginning
    with Version 4.1, Oracle Rdb returns an error message if you try
    to modify a row under these conditions. For example, Oracle Rdb will
    return the error, $RDMS-E-JOIN_CTX_UPD, relation EMPLOYEES is
    part of a join, cannot be updated, when you try to execute the
    following query:

    FOR S IN SALARY_HISTORY CROSS D IN DEGREES CROSS DP IN DEPARTMENTS
        WITH S.EMPLOYEE_ID = D.EMPLOYEE_ID AND
             S.EMPLOYEE_ID = DP.MANAGER_ID AND
             S.SALARY_END MISSING
             D.DEGREE = 'MA'
        MODIFY S USING S.SALARY_AMOUNT = S.SALARY_AMOUNT * 1.1
    END_FOR

    The preceding query will modify some salary history rows more
    than once and gives multiple salary raises to some managers. This
    query can be reworded using a subquery as follows:

    FOR S IN SALARY_HISTORY
        WITH S.SALARY_END MISSING AND
             (ANY D IN DEGREES CROSS DP IN DEPARTMENTS
              WITH S.EMPLOYEE_ID = D.EMPLOYEE_ID AND
              D.DEGREE = "MA")
        MODIFY S USING S.SALARY_AMOUNT - S.SALARY_AMOUNT * 1.1
    END_FOR

    This revised query will work with the new as well as the old
    update rules and it will ensure that each qualified manager gets
    a single salary raise.

    Note that some examples in the Guide to Using RDO, RDBPRE, and RDML
    will not work with the update rules introduced in Oracle Rdb
    Version 4.1. To run these examples, rewrite them using the ANY
    subquery mentioned previously.
Close Help