Build the string you intend to pass. So instead of
example <- sqlQuery(myDB,"SELECT * FROM dbo.my_table_fn (x)")
do
example <- sqlQuery(myDB, paste("SELECT * FROM dbo.my_table_fn (",
x, ")", sep=""))
which will fill in the value of x
.
More Related Contents:
- Dynamic “string” in R
- 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
- Query to get only numbers from a string
- How to create a Calendar table for 100 years in Sql [closed]
- Oracle Differences between NVL and Coalesce
- Grouped LIMIT in PostgreSQL: show the first N rows for each group?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- SQL Server indexes – ascending or descending, what difference does it make?
- Identity column value suddenly jumps to 1001 in sql server [duplicate]
- How to capitalize the first letter of each word in a string in SQL Server
- How to get a list of column names on Sqlite3 database?
- How do I sort a VARCHAR column in SQL server that contains numbers?
- SQL: Select dynamic column name based on variable
- Why do you create a View in a database?
- The SQL OVER() clause – when and why is it useful?
- Cannot use a CONTAINS or FREETEXT predicate on table or indexed view because it is not full-text indexed
- Merge overlapping date intervals
- How does a Recursive CTE run, line by line?
- SQL poor stored procedure execution plan performance – parameter sniffing
- Improving performance of cluster index GUID primary key
- SQL for ordering by number – 1,2,3,4 etc instead of 1,10,11,12
- Mysql strip time component from datetime
- How to detect query which holds the lock in Postgres?
- How to get the next number in a sequence