1

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

1
  • are you looking for the paste() command or do you mean something else? Commented Nov 27, 2013 at 14:57

1 Answer 1

2

I think this is what you are asking?

Newvector<-sqlQuery(channel, paste("SELECT", Testquery, "FROM", Testtanle))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.