[R-sig-DB] RMySQL dbSendQuery

Parlamis Franklin |p@r|@m|@ @end|ng |rom m@c@com
Fri Oct 14 21:55:52 CEST 2005


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)>


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]]




More information about the R-sig-DB mailing list