GETQUERYBANDVALUE_UDF (VARCHAR)
This is the user-defined function (UDF) overloaded with one parameter.
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