[R] RODBC and NULL values

Mark Wardle mark at wardle.org
Tue Oct 17 12:11:20 CEST 2006


Mark Wardle wrote:

> ...
> Is this because my ODBC driver is not returning the correct values for
> RODBC to parse? Is there anyway of debugging this (the intricacies of
> ODBC are beyond my skill) and is my only alternative to store a
> non-valid number in the database (999?) and use my query or R to remove
> those datapoints afterwards?
> ...
> 
Actually, it appears that the Actual ODBC driver isn't returning the
data properly. I've just tested it using Excel and it returns zeros for
NULLs. Wasn't able to use iodbctest as it got very confused and tried to
connect to a MySQL database (which I don't have). There is nothing RODBC
can magic to fix this. It's a bit odd, as I use Filemaker to export data
via raw SQL commands against the ODBC driver, and that does cope with
NULLs, but it appears fetching, at least with Excel and RODBC, does not.

I was just going to try installing "Rdbi" to see whether that has better
luck, but I can't access CRAN this morning. Hopefully the "403
Forbidden" message will be temporary!

So unless anyone knows a better alternative, I shall have to store
nonsense values rather than NULLs in the database (or fix it within the
SELECT query as a quick hack solution instead).

Best wishes,

Mark

-- 
Dr. Mark Wardle
Clinical research fellow and Specialist Registrar in Neurology,
C2-B2 link, Cardiff University, Heath Park, CARDIFF, CF14 4XN. UK



More information about the R-help mailing list