I want to reference a list of values to be used in a sql chunk.
I have tried using the dplyr::translate_sql function to convert the list to a correct syntax, but it doesn't seem to be correct. I can copy and paste the output of the translate_sql object and it will run, but I cannot embed thoe object.
values <- translate_sql(c("value1", "value2", "value3"))
print(values)
<SQL> ('value1', 'value2', 'value3')
select *
from db.table
where column in ?values
I get an error message saying the syntax is incorrect.
However if I just copy and paste the values (See code below, it runs perfectly)
select *
from db.table
where column in ('value1', 'value2', 'value3')