Categories:

Context functions (General)

IS_USER_IMPORTED (SYS_CONTEXT function)

Returns the VARCHAR value 'TRUE' if the specified user is an organization user that was imported into the current account.

See also:

SYS_CONTEXT (SNOWFLAKE$ORGANIZATION namespace) , IS_GROUP_ACTIVATED (SYS_CONTEXT function) , IS_GROUP_IMPORTED (SYS_CONTEXT function)

Syntax

SYS_CONTEXT(
  'SNOWFLAKE$ORGANIZATION' ,
  'IS_USER_IMPORTED' ,
  '<user_name>'
)
Copy

Arguments

'SNOWFLAKE$ORGANIZATION'

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

'IS_USER_IMPORTED'

Calls the IS_USER_IMPORTED function.

'user_name'

Specifies the name of the user to check.

Returns

The function returns one of the following VARCHAR values:

  • 'TRUE' if the user is an organization user that was imported into the current account.

  • 'FALSE' if the user is not an organization user, was not imported into the current account, or is not a valid user.

To compare this return value against the BOOLEAN value TRUE or FALSE, cast the return value to BOOLEAN. For example:

SELECT SYS_CONTEXT('SNOWFLAKE$ORGANIZATION', 'IS_USER_IMPORTED', 'my_user_name')::BOOLEAN = TRUE;
Copy

Usage notes

Examples

The following example returns 'TRUE' if the user my_user_name is an organization user that was imported into the current account:

SELECT SYS_CONTEXT('SNOWFLAKE$ORGANIZATION', 'IS_USER_IMPORTED', 'my_user_name');
Copy
Language: English