delete_cmd := 'delete from test where rdate='||''':run_date'''||';';
The above code is not substituting the date '2022-09-07' assigned to "run_date.
Can you please help with the current substitution?
delete_cmd := 'delete from test where rdate='||''':run_date'''||';';
The above code is not substituting the date '2022-09-07' assigned to "run_date.
Can you please help with the current substitution?
context helps, so lets write a Snowflake Scripting block that sounds like what you described:
and sure enough "it does not work good"
So looking that code, we see you are concatenating three strings together of which the second is triple quoted, thus a string with an embedded quote mark AND the string tokens
:run_dateas text. so lets drop the triple quotes:now we get:
so now the variable is substituted, but the quote is missing.. so we put the embedded quotes in the string parts (the before and after)
the output becomes what we are after: