Categories:

Context functions (General)

SYS_CONTEXT (SNOWFLAKE$ORGANIZATION namespace)¶

Returns information about the current organization.

You can call this function in any account in the organization. In any other context, the function returns NULL.

See also:

SYS_CONTEXT , SYS_CONTEXT (SNOWFLAKE$APPLICATION namespace) , SYS_CONTEXT (SNOWFLAKE$ENVIRONMENT namespace) , SYS_CONTEXT (SNOWFLAKE$ORGANIZATION_SESSION namespace) , SYS_CONTEXT (SNOWFLAKE$SESSION namespace) , IS_GROUP_ACTIVATED (SYS_CONTEXT function) , IS_GROUP_IMPORTED (SYS_CONTEXT function) , IS_USER_IMPORTED (SYS_CONTEXT function)

Syntax¶

Syntax for calling functions:

SYS_CONTEXT(
  'SNOWFLAKE$ORGANIZATION' ,
  '<function>' , '<argument>' [ , ... ]
)
Copy

Arguments¶

'SNOWFLAKE$ORGANIZATION'

Specifies that you want to retrieve a property or call a function to return context information about the current organization.

'function'

Name of the function that you want to call. You can call the following functions:

'argument' [ , ... ]

Arguments to pass to the function that you want to call.

Returns¶

The function returns a VARCHAR value or NULL:

Usage notes¶

  • If you are specifying the function call in a double-quoted string in a shell, escape the $ character with a backslash (\) so that $ORGANIZATION is not interpreted as a shell variable.

    For example, if you are using Snowflake CLI and you are specifying the SQL statement as a command-line argument in double quotes:

    snow sql --query "SELECT SYS_CONTEXT('SNOWFLAKE\$ORGANIZATION', 'IS_USER_IMPORTED', 'my_user_name');"
    
    Copy

Examples¶

See the following topics: