CURRENT_ORGANIZATION_USER
functionsupportedAccounts, users, sessions, warehousesReturns the name of the user currently logged into the system, but only if the user is an organization user.
Syntax
CURRENT_ORGANIZATION_USER()
Returns
If the current user is an organization user, returns a value of type VARCHAR. If the current user is not an organization user, returns NULL.
Usage notes
- To comply with the ANSI standard, this function can be called without parentheses in SQL statements. However, if you are setting a Snowflake Scripting variable to an expression that calls the function (for example, my_var := CURRENT_ORGANIZATION_USER();), you must include the parentheses. For more information, see the usage notes for context functions.
- Unlike the CURRENT_USER context function, this function can return a user when it’s called from a data sharing consumer account.