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: https://github.com/openmpp/openmpp.github.io/wiki

See Also

https://github.com/openmpp/openmpp.github.io/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.6 Index]