SYSTEM$GET_TAG_ON_CURRENT_TABLE
functionsupportedGovernance (policies, tags, data quality)Returns the tag string value assigned to the table based upon the specified tag or NULL if a tag is not assigned to the specified table. Use this function in data protection policy conditions.
Syntax
SYSTEM$GET_TAG_ON_CURRENT_TABLE( '<tag_name>' )
Parameters
| Name | Required | Description |
|---|---|---|
'tag_name' | required | Identifier for the tag as a string. For example, if the tag is named cost_center use 'cost_center' as the argument. |
Usage notes
- Currently, this function can only be used in a data protection policy condition to dynamically evaluate the tag string value set on a table. Snowflake returns an error while using the function in a SELECT query, view, materialized view, or a user-defined function (UDF).
- Note that this function applies to all table-like objects (e.g. views).
- If the tag is a multi-value tag and more than one value is assigned, this function returns an error. To test one value in a policy condition, use SYSTEM$TAG_VALUE_CONTAINS_ON_CURRENT_TABLE.
- The tag must exist when calling this system function; otherwise, Snowflake returns the following error message: Copy code Tag '<tag_name>' does not exist or not authorized.