문제

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

도움이 되었습니까?

해결책

I think this is what you are asking?

Newvector<-sqlQuery(channel, paste("SELECT", Testquery, "FROM", Testtanle))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top