snowflake.snowpark.functions.last_query_id¶
- snowflake.snowpark.functions.last_query_id(num: Union[snowflake.snowpark.column.Column, str] = None) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.40.0/src/snowflake/snowpark/_functions/scalar_functions.py#L981-L1008)¶
Returns the query ID of the last statement executed in the current session. If num is specified, returns the query ID of the nth statement executed in the current session.
- Parameters:
num (ColumnOrName, optional) – The number of statements back to retrieve the query ID for. If None, returns the query ID of the last statement.
- Returns:
The query ID as a string.
- Return type:
Example: