r - RODBC returning 0 values -


i accessing commercial db. via prompt:

 select personcode, persondate codb.mastertable personcode=42  personcode  persondate   ----------- ------------        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011        42 jan  3 2011 

in r:

library(rodbc) query <- "select personcode, persondate codb.mastertable personcode=42"  connection1 <- odbcconnect("resdb", uid="userid", pwd="pwdaccess", believenrows=false)  sqlquery(connection1,query)   sqlquery(connection1,query)     personcode                 persondate  1          42 01/03/2011 00:00:00.000 utc 2          42 01/03/2011 00:00:00.000 utc 3          42 01/03/2011 00:00:00.000 utc 4          42 01/03/2011 00:00:00.000 utc 5          42 01/03/2011 00:00:00.000 utc 6           0 01/03/2011 00:00:00.000 utc 7           0 01/03/2011 00:00:00.000 utc 8           0 01/03/2011 00:00:00.000 utc 9           0 01/03/2011 00:00:00.000 utc 10          0 01/03/2011 00:00:00.000 utc 

the output of query incorrect. has encountered problem before? here additional information.

> sessioninfo() r version 2.12.1 (2010-12-16) platform: x86_64-unknown-linux-gnu (64-bit)  locale: [1] c  attached base packages: [1] stats     graphics  grdevices utils     datasets  methods   base  other attached packages: [1] timedate_2130.92 data.table_1.5.3 rodbc_1.3-2  loaded via namespace (and not attached): [1] tools_2.12.1 

you can use odbcgetinfo() view information on driver being used.

considering origins of odbc, have tried using roracle (dbi package) instead? rjdbc may more stable option in linux environment, fetch() code has been re-written in java (as of development release 0.2-0 on r-forge) performance on par (if not better than) rodbc.

it might sound obvious, problem occur r32 (if that's option you)? 32-bit vs. 64-bit driver incompatibilities can notoriously difficult track down; windows complain architecture mismatch using r64 32-bit odbc driver , cause odbcconnect() fail outright, don't know if linux same.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -