RODBC - 一个sqlQuery()调用中的多个语句

时间:2013-03-09 16:21:55

标签: sql r

在R中,每当我将带有多个语句的查询传递给sqlQuery时,我都会收到错误。 例如,

sqlQuery(ch, 'DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2;')

产生错误

[1] "42000 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.5.27]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 'DROP TABLE IF EXISTS t2' at line 1"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2;'"

我做错了什么?

0 个答案:

没有答案