Learn R Programming

RMySQL (version 0.9-3)

dbEscapeStrings-methods: Escape a Character Vector According to SQL rules

Description

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

Arguments

See Also

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

Examples

Run this code
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)

Run the code above in your browser using DataLab