Issue with Dynamic Variables in SQL Queries After Recent Update

Update! I found this cheat sheet and went to the Snowflake section. Two IN statements cant bind data from arrays (at least for this query Im running). The cheat sheet showed I can in fact do this but in a different way.

The fix:

WHERE 
  ARRAY_CONTAINS(cc.BRANCH_CODE::variant, SPLIT( {{headerBranchCodes.value.join()}}, ',') )
  AND 
    ARRAY_CONTAINS(to_varchar(fm.STATUS)::variant, SPLIT( {{statusFilter.value.join()}}, ',') )

Not entirely sure why the bind error was happening for this specific query since I have a few value IN ({{ item.value }}) being dynamically inserted into my queries elsewhere but this worked for my current use case.

2 Likes