title: How to pass function parameters in sql query in R?
body: <p>I have the following function in <code>R</code>:</p>
  
  <pre><code>dbhandle &lt;- odbcDriverConnect('driver={SQL Server};
                                server=myServer;database=myDB;
                                trusted_connection=true')
  func &lt;- function(x){
       sqlQuery(dbhandle, 'select attr from myTable where cond = x')
  }
  </code></pre>
  
  <p>I want to know how to pass the <code>x</code> parameter to the <code>where</code> condition for the <code>cond</code> attribute. For example, I want to calculate <code>func(10)</code>, then the query must be:</p>
  
  <pre><code>select attr from myTable where cond = 10
  </code></pre>