[R-sig-DB] Vector Operations

Nick Torenvliet n|ck@torenv||et @end|ng |rom gm@||@com
Tue Nov 30 03:34:25 CET 2010


This isn't strictly an DB question, but I'll venture out anyways...

I've got a vector of sql statements called sql

> sql
[1] "select date, open, high, low, close, volume from endOfDayData where
date>'2009-09-01' and market like 'TSX' and symbol like 'AAB' order by date"
.
.
.
[2464] "select date, open, high, low, close, volume from endOfDayData where
date>'2009-09-01' and market like 'TSX' and symbol like 'ZUH' order by date"

[2465] "select date, open, high, low, close, volume from endOfDayData where
date>'2009-09-01' and market like 'TSX' and symbol like 'ZUT' order by
date"

For each element in sql I'd like to run the queries in sql and have them in
another vector of some sort as in the following for loop...

for(x in sql){
allocatedSpace <- dbGetQuery(con, statement=x)
}

Is there a way to do this in a more R-esque vector like fashion/single line?

Regards,

Nick

	[[alternative HTML version deleted]]




More information about the R-sig-DB mailing list