- Categories:
Context functions (General)
SYS_ CONTEXT(SNOWFLAKE$ENVIRONMENT 命名空间)¶
返回有关调用该函数的环境(客户端、当前账户和当前区域)的信息。
语法
实参
'SNOWFLAKE$ENVIRONMENT'指定您要检索一个属性,以返回有关调用函数的环境的上下文信息。
'property'要检索的属性的名称。您可以指定以下属性:
Property Description CLIENT用于调用该函数的客户端、驱动程序或库的名称和版本。
If this function is called in Snowsight, the function returns the name and version of the Go Snowflake Driver.
If this function is called in Snowflake CLI, the function returns the name and version of the Snowflake Connector for Python.
The value of this property is the same as the return value of the CURRENT_CLIENT function.
ACCOUNTThe account locator of the account for the current session.
The value of this property is the same as the return value of the CURRENT_ACCOUNT function.
REGIONThe name of the region of the account for the current session.
For organizations that have accounts in multiple region groups, the value of the property is
region_group.region.The value of this property is the same as the return value of the CURRENT_REGION function.
返回
该函数会返回 VARCHAR 值。
使用说明
-
If you are specifying the function call in a double-quoted string in a shell, escape the
$character with a backslash (\) so that$ENVIRONMENTis 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:
示例
以下示例返回用于执行命令的客户端名称和版本:
以下示例返回当前会话所属账户的账户定位器:
以下示例返回当前会话所属账户的区域: