CITAN (version 2011.08-1)

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

Description

Given a character vector, the function tries to match each of its values up in the array search. On success, corresponding value of replace will is returned. Otherwise, it outputs "NULL".

Usage

sqlSwitchOrNULL(value, search, replace)

Arguments

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

Value

  • The function returns a character vector containing values from replace that correspond to elements of search and/or "NULL"s.

See Also

sqlNumericOrNULL, sqlStringOrNULL, sqlTrim