[R-sig-DB] RMySQL dbSendQuery
Douglas Bates
dmb@te@ @end|ng |rom gm@||@com
Fri Oct 14 22:07:58 CEST 2005
On 10/14/05, Parlamis Franklin <fparlamis using mac.com> wrote:
> When the following statement:
>
> dbSendQuery(MySQL.Connection, "source ~/MySQLFiles/DateTable.sql")
>
> is run from R (where MySQL.Connection is my connection object and
> DateTable is a file containing MySQL statements) I get the following
> error:
>
> Error in mysqlExecStatement(conn, statement, ...) :
> RS-DBI driver: (could not run statement: You have an
> error in your SQL syntax; check the manual that corresponds
> to your MySQL server version for the right syntax to use
> near 'source ~/MySQLFiles/DateTable.sql' at line 1)
>
> However, when I run the exact same statement from an open MySQL
> command line session (cut and pasted), I get the correct result,
> which is that MySQL should run commands from the source file.
>
> Can anyone speculate as to why this happens? Other commands, such as
>
> dbSendQuery(MySQL.Connection, "select 1")
>
> seem to work correctly, as I receive the message
>
> <MySQLResult:(8472,0,24)>
The "source" directive is not part of the SQL language - it is a
convenience feature built into the command line program and
interpreted by that program.
>
>
> I am running MySQL 4.1.14-standard and R 2.1.1 with Cocoa GUI 1.12 on
> a PowerMac G5. Packages DBI and RMySQL are installed
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-DB mailing list -- R Special Interest Group
> R-sig-DB using stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-db
>
More information about the R-sig-DB
mailing list