The ADD_POLICY_CONTEXT procedure is used to add a context association for a policy. The DROP_POLICY_CONTEXT procedure is used to drop the context association for a policy.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support it.
Syntax
ADD_POLICY_CONTEXT
DBMS_RLS.ADD_POLICY_CONTEXT(
object_schema IN VARCHAR2 := NULL,
object_name IN VARCHAR2,
namespace IN VARCHAR2,
attribute IN VARCHAR2);
DROP_POLICY_CONTEXT
DBMS_RLS.DROP_POLICY_CONTEXT(
object_schema IN VARCHAR2 := NULL,
object_name IN VARCHAR2,
namespace IN VARCHAR2,
attribute IN VARCHAR2);
Parameters
Parameter |
Description |
|---|---|
| object_schema | The name of the schema to which the table or view belongs. Default isNULL, indicating the current schema. |
| object_name | The name of the table or view. |
| namespace | Namespace. |
| attribute | Attribute. |
Examples
-- Add Policy Context
BEGIN
DBMS_RLS.ADD_POLICY_CONTEXT(
object_schema => 'hr',
object_name => 'employees',
namespace => 'emp_ns',
attribute => 'dept');
END;
/
-- Delete Policy Context
BEGIN
DBMS_RLS.DROP_POLICY_CONTEXT(
object_schema => 'hr',
object_name => 'employees',
namespace => 'emp_ns',
attribute => 'dept');
END;
/
