Learn R Programming

RMySQL (version 0.9-3)

dbEscapeStrings: Escape SQL-special characters in strings

Description

is expected to be sorted by the grouping field.

Usage

dbEscapeStrings(con, strings, ...)

Arguments

con
a connection object (see dbConnect).
strings
a character vector.
...
any additional arguments to be passed to the dispatched method.

Value

  • A character vector with SQL special characters properly escaped.

Details

dbEscapeStrings

Currently, only the MySQL driver implements this method.

See Also

MySQL dbSendQuery fetch

Examples

Run this code
tmp <- sprintf("select * from emp where lname = %s", "O'Reilly")
sql <- dbEscapeString(con, tmp)
dbGetQuery(con, sql)

Run the code above in your browser using DataLab