dbEscapeStrings-methods {RMySQL} | R Documentation |
Escape SQL-special characters in a character vector according to MySQL rules.
strings
character vector according
to the MySQL escape rules and taking into consideration the character
set used by the connection (each MySQL connection may be set to
use different character sets). Note that the RMySQL
package
currently does not deal with character set conversions – it uses
whatever character encoding the R session is using, but the MySQL
runtime library handles this transparently.
MySQL
,
dbConnect
,
dbSendQuery
,
dbGetQuery
,
fetch
,
dbNextResult
,
dbCommit
,
dbGetInfo
,
dbReadTable
.
## Not run: con <- dbConnect(MySQL(), dbname = "rs-dbi", client.flag=CLIENT\_MULTI\_STATEMENTS) tmp <- sprintf("select * from emp where lname = sql <- dbEscapeString(con, tmp) dbGetQuery(con, sql) ## End(Not run)