title: parameterized SQL query in R with in clause
body: <p>I want to fetch data from SQL Server in R and the query contains "IN" clause. I have written the query in the below format:</p>
  
  <pre><code>res &lt;- fn$sqlQuery(dbhandle, "select * from &lt;tbl&gt; where col1 = '$argv1' and col2 = '$argv2' and col3 in $argv3")
  </code></pre>
  
  <p>and here is how I am passing it from command line:</p>
  
  <pre><code>"C:\Program Files\R\R-3.1.0\bin\x64\Rscript.exe" --slave --vanilla "c:\R\abc.R" "A1" "B1"  ("A11","A12")
  </code></pre>
  
  <p>but it removes the parenthesis around A11 and A12 and hence the query at DB end fails.</p>
  
  <pre><code>[2] "[RODBC] ERROR: Could not SQLExecDirect 'select * from tbl where col1 = 'A1' and col2 = 'B1' and col3 in (A11,A12) '"
  </code></pre>
  
  <p>Is there an easy way to handle this? </p>