Learn R Programming

CITAN (version 2011.04-1)

sqlSwitchOrNULL: Switch-like nullable construct for use in an SQL query

Description

Given a single character string, the function tries to match its value in the array search. On success, a corresponding value of replace is returned. Otherwise, it returns "NULL".

Usage

sqlSwitchOrNULL(value, search, replace)

Arguments

value
value to be processed.
search
character vector of length n.
replace
character vector of length n.

Value

  • The function returns a character string containing a value from replace that corresponds to an element of search or "NULL".

See Also

sqlNumericOrNULL, sqlStringOrNULL, sqlTrim