Search code examples
snowflake-cloud-data-platformsnowflake-task

insert LAST_QUERY_ID value while inserting data in a table via stored proc in Snowflake


I'm inserting data into Snowflake table via stored proc. I have a column in table where i want to capture the query id when the insert statement will run. Any suggestions how this can be achieved?

Cheers,


Solution

  • Sorry, but not likely - last query id is only granted when the query is sent for execution, so you can't get it for "this" query. you can try to do this retrospectively (so first insert and then update), but i'm afraid that in turn won't be too concurrent

    question is however - what exactly are you trying to achieve, maybe there is an easier way?