"as.is" for dbGetQuery?

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

"as.is" for dbGetQuery?

Jim Porzak

I'm using RJDBC/DBI to query a MS SQL DB that looks like:

YMDHMs               Num1stsAboveBaseline
2009-05-18 00:00 1
2009-05-18 00:01 2
2009-05-18 00:02 2

The first column will get converted to POSIXct.

However, dbGetQuery converts the first column to a factor - which
kills performance when I go against a production table with a few 100k

Using read.table() against the equivalent text file allows me to say
"as.is = 1" resulting in characters.

I don't see any equivalent in dbGetQuery (nor in dbSetQuery & fetch)

What am I missing?

Jim Porzak
San Francisco, CA
use R! Group SF: www.meetup.com/R-Users/

[hidden email] mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.