keyValuesToSql: List of Key = Value Pairs to SQL Expressions

View source: R/sql.R

keyValuesToSqlR Documentation

List of Key = Value Pairs to SQL Expressions

Description

List of Key = Value Pairs to SQL Expressions

Usage

keyValuesToSql(keyValues, filter, like = filter)

Arguments

keyValues

list of key = value pairs

filter

logical. If TRUE the target is an SQL filter expression, otherwise an SQL SET expression.

like

passed to keyValueToSql

Examples

keyValues <- list(name = "Peter", birth = as.POSIXct("1999-09-09"))

setCurrentSqlDialect("msaccess")
cat(keyValuesToSql(keyValues, filter = TRUE))
cat(keyValuesToSql(keyValues, filter = TRUE, like = FALSE))
cat(keyValuesToSql(keyValues, filter = FALSE))

setCurrentSqlDialect("mysql")
cat(keyValuesToSql(keyValues, filter = TRUE))
cat(keyValuesToSql(keyValues, filter = TRUE, like = FALSE))
cat(keyValuesToSql(keyValues, filter = FALSE))


KWB-R/kwb.db documentation built on Oct. 1, 2023, 4:10 a.m.