GETQUERYBANDVALUE_UDF (VARCHAR)

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

Retrieves the value associated with a name inside the name-value pairs of the transaction, session, or profile query band.

GETQUERYBANDVALUE_UDF(SEARCHNAME VARCHAR)

Parameters

SEARCHNAME VARCHAR

The name key to search in the pairs.

Returns

The value associated with the name key inside the session query band or null if not found.

Usage example

Input:

ALTER SESSION SET QUERY_TAG = 'user=Tyrone;role=security';
SELECT GETQUERYBANDVALUE_UDF('role');

Output:

security

Migration example

Input:

SELECT GETQUERYBANDVALUE(1, 'group');

Output:

/** MSC-ERROR - MSCEWI2084 - TRANSACTION AND PROFILE LEVEL QUERY TAGS NOT SUPPORTED IN SNOWFLAKE, REFERENCING SESSION QUERY TAG INSTEAD **/
SELECT GETQUERYBANDVALUE_UDF('group');

Last updated