SQL$HELP_OLD72.HLB  —  Built In Functions, CURRENT_USER
    The CURRENT_USER function returns the current active user name
    for a request.

    If a definer's rights request is executing, the CURRENT_USER
    function returns the rights identifier of the module definer. If
    a definer's rights request is not executing, CURRENT_USER returns
    the session user name, if it exists. Otherwise, CURRENT_USER
    returns the system user name. See Authorization Identifiers for
    more information.

    The resulting data type is CHAR(31).

    The CURRENT_USER function does not return the definer's user name
    of a trigger.

    Example: Using the CURRENT_USER function

    Example 1: To allow users access only to the rows they inserted,
    create a view

    SQL> CREATE VIEW SELECTIVE_EMPLOYEES_UPDATE AS
    cont>   SELECT * FROM EMPLOYEES
    cont>   WHERE USER_ID = CURRENT_USER
    cont>   WITH CHECK OPTION CONSTRAINT MUST_HAVE_USER;
Close Help