[R] sqldf and number of records affected

Gabor Grothendieck ggrothend|eck @end|ng |rom gm@||@com
Thu Jun 11 15:12:22 CEST 2020

Here is an example.  Ignore the warning or use the workaround discussed here
to avoid the warning.

  sqldf()  # use same connection until next sqldf()
  sqldf(c("pragma count_changes = 1", "update BOD set demand = 99
where Time > 4"))
  sqldf("select * from main.BOD")

On Thu, Jun 11, 2020 at 9:01 AM Ravi Jeyaraman <ravi76 using gmail.com> wrote:
> Hello all, When I execute a SQL using SQLDF, how do I get the number of
> records affected?  I mean, if I run an UPDATE on a data frame, it doesn't
> tell me if and how many records got updated.  I've read through the
> documentation and there don't seem to be a way to get this info unless it's
> done on a database.  Any ideas?
> Thanks
> Ravi
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
> ______________________________________________
> 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.

Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

More information about the R-help mailing list