dbEscapeStrings-methods {RMySQL} | R Documentation

## Escape a Character Vector According to SQL rules

### Description

Escape SQL-special characters in a character vector according to MySQL rules.

### Methods

con = "MySQLConnection", strings = "character"
  This method encodes the `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.
...
  currently unused.

### See Also

`MySQL`, `dbConnect`, `dbSendQuery`, `dbGetQuery`, `fetch`, `dbNextResult`, `dbCommit`, `dbGetInfo`, `dbReadTable`.

### Examples

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

[Package RMySQL version 0.6-0 Index]