SYSTEM$TAG_VALUE_CONTAINS_ON_CURRENT_COLUMN
functionsupportedCore SQL functionsReturns TRUE if the specified tag on the column that a policy protects contains the specified string value. Returns FALSE if that value is not assigned, or if the tag is not assigned. Use this function in column-level protection policies, such as masking policies and projection policies, when a tag might have more than one value. SYSTEM$GET_TAG_ON_CURRENT_COLUMN returns an error when multiple values exist. For more information, see Multi-value tags.
Syntax
SYSTEM$TAG_VALUE_CONTAINS_ON_CURRENT_COLUMN( '<tag_name>' , '<value>' )
Parameters
| Name | Required | Description |
|---|---|---|
'tag_name' | required | Name of the tag, as a string literal. Snowflake resolves the name when you create or alter the policy, in the schema in use for that statement. Use a fully qualified name for a tag in another schema. |
'value' | required | Tag value to test for, as a string literal. |
Returns
Returns a BOOLEAN: TRUE if the value is assigned to a tag attached directly to the current column. If the column has no directly attached tag, TRUE if the value is assigned on an inherited tag. FALSE otherwise.
Usage notes
- Call this function from a column-level protection policy condition, such as a masking policy or a projection policy. Snowflake returns an error if you call it in a SELECT query, a row access policy, a view, or a user-defined function (UDF).
- Both arguments must be string literals.
- The tag must exist when you create or alter the policy. Otherwise, Snowflake returns the following error message: Tag '<tag_name>' does not exist or not authorized.
- The comparison is case-sensitive. On a multi-value tag, the function returns TRUE when <value> is one of the assigned values. It also returns TRUE when <value> equals the single value of a tag that is not multi-value.
- The function checks tags attached directly to the column. If the column has no directly attached tag, the function checks inherited tags.
- This function applies to table-like objects, such as views.