获取上一查询的查询 ID¶
如果需要访问已执行的最后一个查询的查询 ID,请使用全局变量 SQLID。
备注
如果未执行查询,则 SQLID 的默认值为 NULL。
以下示例执行两个查询,并返回一个包含查询 IDs 的 ARRAY 查询:
Note: If you use Snowflake CLI, SnowSQL, the Classic Console, or the
execute_stream or execute_string method in Python Connector
code, use this example instead (see Using Snowflake Scripting in Snowflake CLI, SnowSQL, and Python Connector):