Use DBMS_APPLICATION_INFO and USERENV() in building a publish-and-subscribe implementation.
SQL>
SQL> SET SERVEROUTPUT ON SIZE 1000000
SQL>
SQL> SELECT USERENV('CLIENT_INFO')
2 FROM dual;
USERENV('CLIENT_INFO')
----------------------------------------------------------------
1
1 row selected.
SQL>
SQL>
SQL> EXECUTE DBMS_APPLICATION_INFO.SET_CLIENT_INFO('1');
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> SELECT USERENV('CLIENT_INFO')
2 FROM dual;
USERENV('CLIENT_INFO')
----------------------------------------------------------------
1
1 row selected.
SQL>
SQL>
SQL>
Related examples in the same category