Skip to contents

Generate SQL Filter or Assignment Expression

Usage

keyValueToSql(cname, cvalue, like = TRUE, filter = TRUE)

Arguments

cname

field name

cvalue

field value

like

if TRUE, the SQL comparison operator will be LIKE instead of =.

filter

if TRUE an SQL filter expression is returned, otherwise an SQL assignment expression

Value

(vector of) character representing an SQL expression

Examples

cat(kwb.db:::keyValueToSql("age", 1))
#> age = 1
cat(kwb.db:::keyValueToSql("name", "peter"))
#> name  LIKE  "peter"
cat(kwb.db:::keyValueToSql("name", "peter", like = FALSE))
#> name = "peter"