Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

toSQLStringSet

Convert a vector to a quoted string for use as a SQL value list


Description

Given a vector, this function returns a string with each element of the input coerced to character, quoted, and separated by ",".

Usage

toSQLStringSet(names)

Arguments

names

A vector of values to quote

Details

If names is a character vector with elements containing single quotes, these quotes will be doubled so as to escape the quote in SQL.

Value

A character vector of length one that represents the input vector as a SQL value list. Each element is single quoted and elements are comma separated.

Note

Do not use sQuote for generating SQL as that function is intended for display purposes only. In some locales, sQuote will generate fancy quotes which will break your SQL.

Author(s)

Hervé Pagès

Examples

toSQLStringSet(letters[1:4])
toSQLStringSet(c("'foo'", "ab'cd", "bar"))

AnnotationDbi

Manipulation of SQLite-based annotations in Bioconductor

v1.52.0
Artistic-2.0
Authors
Hervé Pagès, Marc Carlson, Seth Falcon, Nianhua Li
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.