Categories:

System Functions

SYSTEM$GET_TAG_ON_CURRENT_TABLE

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 the masking policy conditions or the row access policy conditions.

Syntax

SYSTEM$GET_TAG_ON_CURRENT_TABLE( '<tag_name>' )

Arguments

'tag_name'

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 masking policy or row access 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).

Examples

For a contextual example on how to use this function, see Example 3: Protect a Table Based on the Table Tag String Value.

Back to top