toQuoted {openMpp}R Documentation

Return SQL-quoted string

Description

Return SQL-quoted string: O'Connor -> 'O”Connor'

Usage

  toQuoted(srcStr)

Arguments

srcStr

srcStr source string

Details

Duplicate each apostrophe and enclose result in 'apostrophes'

Value

Return SQL-quoted string: O'Connor -> 'O”Connor'

Author(s)

amc1999

References

OpenM++ documentation: http://ompp.sourceforge.net/wiki/

See Also

http://ompp.sourceforge.net/wiki/

Examples

someName <- toQuoted("O'Connor")
# someName
# [1] "'O''Connor'"

sql <- paste(
  "SELECT * FROM someTable WHERE name = ", toQuoted("O'Connor"), sep=""
  )

# sql
# [1] "SELECT * FROM someTable WHERE name = 'O''Connor'"

[Package openMpp version 0.8.1 Index]