[R] From within R, what are "good" ways to run SQL code contained in a text file?

Kelly Thompson kt1572757 @end|ng |rom gm@||@com
Wed May 18 22:18:14 CEST 2022

Thanks. Please, can you elaborate and explain what you mean when you
say "I reject the whole premise of your question".

On Wed, May 18, 2022 at 11:52 AM Jeff Newmiller
<jdnewmil using dcn.davis.ca.us> wrote:
> Running external SQL files that you modify on the fly is almost certainly not a good idea because you should not be parameterizing with string manipulation but with dedicated parameterization code (e.g. [1]). Otherwise you risk encountering Little Bobby Tables (https://www.explainxkcd.com/wiki/index.php/Little_Bobby_Tables). Since this requires custom R code anyway, I reject the whole premise of your question.
> [1] https://cran.r-project.org/web/packages/DBI/vignettes/DBI-advanced.html
> On May 18, 2022 10:01:10 AM PDT, Kelly Thompson <kt1572757 using gmail.com> wrote:
> >I am interested in this topic and found this post on StackOverflow,
> >https://stackoverflow.com/questions/44853322/how-to-read-the-contents-of-an-sql-file-into-an-r-script-to-run-a-query
> >
> >This response seems especially useful,
> >https://stackoverflow.com/a/44886192/10816734
> >
> >I'm curious about the thoughts and insights people here in r-help have
> >about this question and topic, and to learn if there are "better" ways
> >than what is suggested in the StackOverflow thread.
> >
> >Thank you!
> >
> >______________________________________________
> >R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >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.
> --
> Sent from my phone. Please excuse my brevity.

More information about the R-help mailing list