sql_list: Convert R vector to Single SQL Query Clause String.

Description Usage Arguments Details Value Examples

Description

sql_list() Returns a character string which can be pasted into a SQL query without throwing an error.

Usage

1
sql_list(MyVector)

Arguments

MyVector

A single dimension vector. Will be cast to character with as.character()

Details

Usually used in SQL WHERE clause as paste("... WHERE <exp> IN", sql_list(vector)).

Value

A single character sting of elements in the input vector surrounded by parens. Each element is enclosed in single quotes and seperated by commas.

Examples

1
2
sql_list(c(1, 2, 3))
sql_list(c("a", "b", "c"))

ds4ci/ds4ciMisc documentation built on May 15, 2019, 2:56 p.m.