Invalid RODBC SQL Error Syntax

This bit of code works fine on R under Windows, but works under Linux Mint 17.1, it throws an error.

intcal <- sqlFetch(db, "intercal_samples")

      

Here's the error:

[1] "42000 102 [FreeTDS][SQL Server]Incorrect syntax near 'intercal_samples'."   
[2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT * FROM \"intercal_samples\"'"

      

Interestingly, this equivalent code works fine on both systems.

intcal <- sqlQuery(db, paste("select * from ", "intercal_samples"))

      

It seems to be some kind of quoting / escape issue, but I can't figure it out. Is this a bug in RODBC or am I missing something?

+3


source to share





All Articles