Last active
November 4, 2015 21:51
-
-
Save ClintWeathers/7335eea73a047caf7a0f to your computer and use it in GitHub Desktop.
paramaterized query using ldply.R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RODBC) | |
library(RODBCext) | |
dbconn <- odbcConnect(dsn = "dbname", uid = "me", pwd = "password") | |
query <- "select * from table where blah = 'blahblahblah' and blah2 = ?" | |
results <- function(x){ | |
sqlExecute(dbconn, query, x) | |
sqlGetResults(dbconn) | |
} | |
output <- plyr::ldply(dataframe$thingy, results, .progress = 'time') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rough dplyr equiv: