CITAN (version 2011.08-1)

sqlEscape: Escape character strings for use in an SQL query

Description

Escapes character strings for use in an SQL query.

Usage

sqlEscape(str, useBytes=FALSE)

Arguments

str
a character vector where matches are sought, or an object which can be coerced by as.character to a character vector.
useBytes
logical. If TRUE the matching is done byte-by-byte rather than character-by-character. See man page for gsub.

Value

  • See 'Value' for gsub.

Details

The SQL standard specifies that single-quotes in strings should be escaped by putting two single quotes in a row. This function repeats the quotes using gsub.

See Also

gsub, sqlTrim, sqlEscapeTrim