Store a SQL result in a variable
I want to store a SQL result in a variable. There doesn't appear to be an easy way to do this in Snowflake Matillion.
I have a batchid that I increment by one at the end of my load. I want to grab the current batchid and reference that in other parts of the job (eg. the load).
I want to SELECT max(batchid) from etl.batch_id and store the resulting 1 row of output in my $client_batchid variable.