Domanda

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

È stato utile?

Soluzione

I think this is what you are asking?

Newvector<-sqlQuery(channel, paste("SELECT", Testquery, "FROM", Testtanle))
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top