Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

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.


1 Community Answers

Anthony Schneider —

Found the answer to this myself (I think the documentation could be clearer). Use a Table Iterator and in the column mapping choose the column for the table or view with one result and map to variable.

Post Your Community Answer

To add an answer please login