Re: [R] RODBC to query an Oracle table

2008-07-28 Thread David Scott
On Mon, 28 Jul 2008, Megan J Bellamy wrote: Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread Jim Porzak
Hi Megan, Marc's hint is the R way, which is needed with your original SELECT. OTOH, it may be more efficient to move the WHERE clause into the SELECT. Something like select plotnum, sampyear, sptype from density where sampyear=1995 AND plotnum=1 AND sptype IN ('S', 'H') should work i

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread Prof Brian Ripley
It's your R syntax that is faulty: Use "" (not ') to delimit the R string which contains single quotes for use by SQL. On Mon, 28 Jul 2008, Megan J Bellamy wrote: Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well b

Re: [R] RODBC to query an Oracle table

2008-07-28 Thread Marc Schwartz
on 07/28/2008 09:44 AM Megan J Bellamy wrote: Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or te

[R] RODBC to query an Oracle table

2008-07-28 Thread Megan J Bellamy
Hello all, I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or tell me if I am going about this the correct wa