title: Pass R variable to RODBC's sqlQuery?
body: <p>Is there any way to pass a variable defined within R to the sqlQuery function within the RODBC package?</p>
  
  <p>Specifically, I need to pass such a variable to either a scalar/table-valued function, a stored procedure, and/or perhaps the WHERE clause of a SELECT statement.</p>
  
  <p>For example, let:</p>
  
  <pre><code>x &lt;- 1 ## user-defined
  </code></pre>
  
  <p>Then,</p>
  
  <pre><code>example &lt;- sqlQuery(myDB,"SELECT * FROM dbo.my_table_fn (x)")
  </code></pre>
  
  <p>Or...</p>
  
  <pre><code>example2 &lt;- sqlQuery(myDB,"SELECT * FROM dbo.some_random_table AS foo WHERE foo.ID = x")
  </code></pre>
  
  <p>Or...</p>
  
  <pre><code>example3 &lt;- sqlQuery(myDB,"EXEC dbo.my_stored_proc (x)")
  </code></pre>
  
  <p>Obviously, none of these work, but I'm thinking that there's something that enables this sort of functionality.</p>