The CLEAR_CONTEXT procedure clears the application context in the specified namespace.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_SESSION.CLEAR_CONTEXT(
namespace VARCHAR2,
client_identifier VARCHAR2
attribute VARCHAR2);
Parameters
| Parameter | Description |
|---|---|
| namespace | Required. The namespace from which the application context is to be cleared.
|
| client_identifier | Optional. The client identifier. This parameter applies to global contexts and is optional for contexts of other types. The client identifier contains a maximum of 64 bytes in length. NULL is a valid value of client_identifier for distinguishing from the context (such as the namespace, attribute, value, username, or NULL) specified by using SET_CONTEXT. |
| attribute | Optional. The attribute to be cleared from the namespace. Default value: NULL. If you set attribute to NULL, the namespace, attribute, and value information of this namespace is cleared from the session. If attribute is not specified, the information of all contexts with the namespace and client_identifier parameters. |
Considerations
The CLEAR_CONTEXT procedure must be directly or indirectly called by a trusted package.
Any change made by using the CLEAR_CONTEXT procedure to the context value takes effect immediately and subsequent calls to access the value by using the SYS_CONTEXT function return the latest value.
Examples
BEGIN
DBMS_SESSION.CLEAR_CONTEXT('emp_context');
END;