The SA_SESSION.SET_LABEL procedure sets the label for the current database session.
You can set the session label to a level equal to or lower than the maximum level and equal to or higher than the minimum level.
Note: If you change the session label, the value of the row label of the session may be affected. The row label of the session may not be identical with the session label.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
SA_SESSION.SET_LABEL (
policy_name IN VARCHAR,
label IN VARCHAR);
Parameters
| Parameter | Description |
|---|---|
| policy_name | The policy name. You can query the POLICY_NAME column of the ALL_SA_POLICIES data dictionary view for existing policies. |
| label | The value to be set as the label. |
Examples
The following example sets the label for shield_agent_policy:
BEGIN
SA_SESSION.SET_LABEL (
policy_name => 'shield_agent_policy',
label => 'L6');
END;
/