powered by
Escape SQL-special characters in strings.
dbEscapeStrings(con, strings, ...)# S4 method for MySQLConnection,character dbEscapeStrings(con, strings)# S4 method for MySQLResult,character dbEscapeStrings(con, strings, ...)
# S4 method for MySQLConnection,character dbEscapeStrings(con, strings)
# S4 method for MySQLResult,character dbEscapeStrings(con, strings, ...)
A character vector with SQL special characters properly escaped.
a connection object (see dbConnect).
dbConnect
a character vector.
any additional arguments to be passed to the dispatched method.
if (mysqlHasDefault()) { con <- dbConnect(RMySQL::MySQL(), dbname = "test") tmp <- sprintf("SELECT * FROM emp WHERE lname = %s", "O'Reilly") dbEscapeStrings(con, tmp) dbDisconnect(con) }
Run the code above in your browser using DataLab