The SET_ACTION procedure sets the name of the current operation in the current module.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_APPLICATION_INFO.SET_ACTION (
action_name IN VARCHAR2);
Parameters
The action_name parameter specifies the name of the current operation in the current module. When the current operation ends, this procedure is called to set the name of the next operation. If the next operation does not exist, NULL is called. If the name exceeds 32 bytes, the excess part will be truncated.
Considerations
The operation name must be text describing the operation being performed. You may need to set the operation name before each transaction starts. After a transaction completes, set the transaction name to NULL, so that subsequent transactions are properly recorded. If the transaction name is not set to NULL, subsequent transactions may be recorded in the name of the previous transaction.
Examples
CREATE or replace PROCEDURE addemployee(
ename VARCHAR2,
esalary NUMBER,
emanager NUMBER,
etitle VARCHAR2,
ecommission NUMBER,
edepartment NUMBER) AS
BEGIN
DBMS_APPLICATION_INFO.SET_ACTION(
action_name => 'count the employee');
SELECT COUNT(*) FROM emp;
DBMS_APPLICATION_INFO.SET_ACTION(null);
END;