Skip to content
Prev 79358 / 398502 Next

RE : sqlQuery and string selection

Dear Prof Ripley,

I tried what you suggested and it worked perfectly well! 
I also appreciated your corrections about my SQL formulation. However, it
seems that quotes are indeed needed to get string observations (but my
access software is in french...).
Finally, do you think that it might be worth to add an example for sqlQuery
using string variables in a later version of RODBC, just in case others
encounter the same problem as me?

I thank you very much for your help,


J??r??me Lema??tre
Ph.D. student
D??partment of biology,
University Laval
Quebec, Canada


-----Message d'origine-----
De??: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Envoy????: 19 octobre 2005 18:23
????: J??r??me Lema??tre
Cc??: R-help at stat.math.ethz.ch
Objet??: Re: [R] sqlQuery and string selection

The syntax error is that you have unescaped quotes inside quotes.
You also do not need a semicolon, nor to refer to columns in this
table.column form.  Try

'select sex from Micromammiferes where sex="females"'

(I suspect you do not need quotes, but keep forgetting the quirks of
various DBMSs.)
On Wed, 19 Oct 2005, J??r??me Lema??tre wrote:

            
database
http://www.R-project.org/posting-guide.html