I am trying to run a query from R to an Oracle DB. Trouble is, that the string doesn't like the double quotes ". For example, I'd like to run the query:
select T.* from xyz.table1 T where T."ID"='123'
In R this would work like this:
sql<-"select T.* from xyz.table1 T where T."ID"='123'"
R returns an Error, saying:
Error: unexpected symbol in sql<-"select T.* from xyz.table1 T where T."
Note: We need to use "
around ID, as we want to force case-sensitivity, so that it doesn't match columns like: id, Id.
You need to use a backslash \
to escape the double quotes.
The command you need is:
sql <- "select T.* from xyz.table1 T where T.\"ID\"='123'"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With