The SA_SESSION.SET_LABEL procedure sets the default row label value for the current database session.
If the user did not explicitly specify the label during the setting of the LABEL_DEFAULT option, this row label value is used during insertion.
If the default row label value is not set by using SA_SESSION.SET_ROW_LABEL, this value is automatically derived from the session label. This value contains the level of the session label.
If the session label changes, the row label is automatically reset. For example, if you change the session level from HIGHLY_SENSITIVE to SENSITIVE, the level of the row label will automatically change to SENSITIVE.
You can set the row label independently, but the level of the label cannot be higher than that of the session label and cannot be lower than the minimum level of the user.
Invalid row labels are not allowed. If you attempt to set invalid row labels, the row label value remains unchanged.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
SA_SESSION.SET_ROW_LABEL (
policy_name IN VARCHAR,
row_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. |
| row_label | The value to be set as the default row label. |
Examples
The following example sets the row label for shield_agent_policy:
BEGIN
SA_SESSION.SET_ROW_LABEL (
policy_name => 'shield_agent_policy',
row_label => 'L5');
END;
/