Reading column names with spaces using dbGetQuery

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Reading column names with spaces using dbGetQuery

Raji
 I have been trying to read a dataset which has spaces in column names using dbGetQuery from RJDBC.

 dataFrame<-dbGetQuery(conn,"select 'Sepal Length','Sepal Width' from "326_1_Result")
The resulting dataframe contains column names as

"Sepal.Length" "Sepal.Width"

But i would like to maintain the spaces in column names as it is.Is there any method is R similar to check.names=FALSE , which can be used in dbGetQuery for maintaining the spaces in column names.

Thanks for your help.