Escape SQL-special characters in strings.
Escape SQL-special characters in strings.
dbEscapeStrings(con, strings, ...) ## S4 method for signature 'MySQLConnection,character' dbEscapeStrings(con, strings) ## S4 method for signature 'MySQLResult,character' dbEscapeStrings(con, strings, ...)
con |
a connection object (see |
strings |
a character vector. |
... |
any additional arguments to be passed to the dispatched method. |
A character vector with SQL special characters properly escaped.
if (mysqlHasDefault()) { con <- dbConnect(RMySQL::MySQL(), dbname = "test") tmp <- sprintf("SELECT * FROM emp WHERE lname = %s", "O'Reilly") dbEscapeStrings(con, tmp) dbDisconnect(con) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.