Categories:

Context functions (General)

IS_GROUP_IMPORTED(SYS_CONTEXT 函数)

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

See also:

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

语法

SYS_CONTEXT(
  'SNOWFLAKE$ORGANIZATION' ,
  'IS_GROUP_IMPORTED' ,
  '<group_name>'
)

实参

'SNOWFLAKE$ORGANIZATION'

指定您要调用函数以返回有关当前组织的上下文信息。

'IS_GROUP_IMPORTED'

调用 IS_GROUP_IMPORTED 函数。

'group_name'

指定要检查的组织用户组的名称。

返回

该函数返回以下 VARCHAR 值之一:

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

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_GROUP_IMPORTED', 'my_group_name')::BOOLEAN = TRUE;

使用说明

示例

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

SELECT SYS_CONTEXT('SNOWFLAKE$ORGANIZATION', 'IS_GROUP_IMPORTED', 'my_group_name');