We can use paste:
Df <- sqlQuery(ch, paste("SELECT * FROM tblTest WHERE Id =", Id))
c
concatenates into a vector, paste
is for string concatenation.
Or we can use sprintf:
sprintf("SELECT * FROM tblTest WHERE Id = %s", Id)
More Related Contents:
- Pass R variable to RODBC’s sqlQuery? [duplicate]
- Parameterized queries with RODBC
- RODBC Temporary Table Issue when connecting to MS SQL Server
- dplyr left_join by less than, greater than condition
- How to emulate SQLs rank functions in R?
- How to read the contents of an .sql file into an R script to run a query?
- Pass string variable in R script to use it in SQL statement
- Re-Writing “Fuzzy Join” Functions from R to SQL
- SQL Selecting from three tables
- How to cast the DateTime to Time
- Inner join vs Where
- Computed / calculated / virtual / derived columns in PostgreSQL
- Generate a resultset of incrementing dates in TSQL
- Xcode 4 and Core Data: How to enable SQL Debugging
- How to use parameters “@” in an SQL command in VB
- JPQL IN clause: Java-Arrays (or Lists, Sets…)?
- Finding similar strings with PostgreSQL quickly
- Why use a JOIN clause versus a WHERE condition?
- How do I alter the position of a column in a PostgreSQL database table?
- How to unpivot in BigQuery?
- Get the last day of the month in SQL
- How to convert PostgreSQL 9.4’s jsonb type to float
- Find rows that have the same value on a column in MySQL
- Referencing current row in FILTER clause of window function
- SQL take just the numeric values from a varchar
- SQL Server 2005 – Export table programmatically (run a .sql file to rebuild it)
- Replacing NULL and empty string within Select statement
- SQL SERVER DATETIME FORMAT
- SQL WITH clause example [duplicate]
- Why isn’t row level security enabled for Postgres views?