On 5/11/10 5:01 AM, jim holtman wrote:
?paste

On Mon, May 10, 2010 at 6:21 PM, Jonathan Greenberg
<greenb...@ucdavis.edu>wrote:

Rhelpers:

I'd like to modify this RSQLite statement:

rs_stations<-dbSendQuery(con_stations, "select * from stations")

so that stations is actually an R variable, e.g.:

stations=c("stationA","stationB")

How would I modify the above statement to query from stations[[1]]
(aka "stationA")?

In the end, I think paste is your only option. The latest version of RSQLite does support parameterized SELECT queries, but you cannot use the parameters to specify table names, only values.

For details of what is supported, try reading through the examples in help("dbSendPreparedQuery")


+ seth

--
Seth Falcon | @sfalcon | http://userprimary.net/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to