Oracle7 Server Tuning

Contents Index Home Previous Next

Setting the Module Name

To set the name of the current application or module, use the SET_MODULE procedure in the DBMS_APPLICATION_INFO package. The module name should be the name of the procedure (if using stored procedures), or the name of the application. The action name should be descriptive text about the action the module is performing.

Example

The following is an example of a PL/SQL block that sets the module name and action name:

CREATE PROCEDURE add_employee(
				name		VARCHAR2(20),
				salary		NUMBER(7,2),
				manager		NUMBER,
				title		VARCHAR2(9),
				commission	NUMBER(7,2),
				department	NUMBER(2))  AS
BEGIN
   DBMS_APPLICATION_INFO.SET_MODULE(
       module_name => 'add_employee',
       action_name => 'insert into emp');
   INSERT INTO emp 
      (ename, empno, sal, mgr, job, hiredate, comm, deptno)
      VALUES (name, next.emp_seq, manager, title, SYSDATE, 
              commission, department);
   DBMS_APPLICATION_INFO.SET_MODULE('','');
END;

Syntax

The parameters for the SET_MODULE procedure are described in Table 3 - 2. The syntax for this procedure is shown below:

DBMS_APPLICATION_INFO.SET_MODULE(
				module_name	IN	VARCHAR2,
				action_name	IN	VARCHAR2)

Parameter Description
module_name The name of the module that is currently running. When the current module terminates, call this procedure with the name of the new module if there is one, or null if there is not. Names longer than 48 bytes are truncated.
action_name The name of the current action within the current module. If you do not want to specify an action, this value should be null. Names longer than 32 bytes are truncated.
Table 3 - 2. Parameters for SET_MODULE Procedure


Contents Index Home Previous Next