[R-sig-DB] RMySQL dbSendQuery
Herve Pages
hp@ge@ @end|ng |rom |hcrc@org
Fri Oct 14 23:02:05 CEST 2005
Parlamis Franklin wrote:
> Thank you both for your responses. I understand now. I need to run
> some R code, followed by some SQL code, followed again by some R
> code, and wanted to do it from a single script. dbSendQuery has a
> one-statement limit, which I was trying to avoid. Perhaps i will
> concatenate all my commands into a single semicolon-separated string
> and send that using dbQuery.
>
Or, if your "DateTable.sql" file is big, do a loop in R that reads its
content SQL statement by
SQL statement (easy to do if you have exactly one statement per line,
but more complicated
if you have several statements on the same line or a statement splitted
over several lines)
and sends each statement separately to the MySQL server. Advantage: (1)
you have more
control and can handle errors returned by the server more easily, (2)
you don't have to load
all the file into memory before to send it.
--
------------------------
Hervé Pagès
E-mail: hpages using fhcrc.org
Phone: (206) 667-5791
Fax: (206) 667-1319
More information about the R-sig-DB
mailing list