Re: [R] RODBC, sqlQuery with NA:s

From: Mark Wardle <>
Date: Tue 03 Apr 2007 - 08:41:31 GMT

Lauri Nikkinen wrote:
> Thanks Prof Ripley for your answer. In fact, there is no NULL's in these
> varchar variables, that is because one of the software's we use do not
> accept NULL's (that is strange, isn't it?). So, for instance, when I type
> select * from table1
> where var1=''
> I get all those rows where the cells of var1 are empty. So, is there any
> possibility to tell R that it should convert these empty cells to NA:s (when
> importing)?

You could use a SQL case statement to do some pre-processing so that RODBC can do the right thing.

Best wishes,


Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Apr 03 19:23:14 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 03 Apr 2007 - 09:30:45 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.