Pregunta

I got a special problem I try to standadize SQL queries since they come up several times in my file.

An example.

at the top I want to define the column name and the table

Testquery <- c("COLUMN1")
Testtanle <- c("TABLE1")

Down the road in my code I want this to be implemented in a SQL query

Newvector<-sqlQuery(channel, "SELECT" Testquery "FROM" Testtanle)

Of course I run into problems with the "". Anyone an Idea how to handle this?

Thanks in advance

¿Fue útil?

Solución

I think this is what you are asking?

Newvector<-sqlQuery(channel, paste("SELECT", Testquery, "FROM", Testtanle))
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top