dbEscapeStrings

0th

Percentile

Escape SQL-special characters in strings.

Escape SQL-special characters in strings.

Usage
dbEscapeStrings(con, strings, ...)

# S4 method for MySQLConnection,character dbEscapeStrings(con, strings)

# S4 method for MySQLResult,character 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.

Aliases
  • dbEscapeStrings
  • dbEscapeStrings,MySQLConnection,character-method
  • dbEscapeStrings,MySQLResult,character-method
Examples
# NOT RUN {
if (mysqlHasDefault()) {
con <- dbConnect(RMySQL::MySQL(), dbname = "test")

tmp <- sprintf("SELECT * FROM emp WHERE lname = %s", "O'Reilly")
dbEscapeStrings(con, tmp)

dbDisconnect(con)
}
# }
Documentation reproduced from package RMySQL, version 0.10.16, License: GPL-2

Community examples

Looks like there are no examples yet.