description |
---|
Returns a masked version of a string. |
- expression: The string to mask.
- uc_mask: Controls the mask character for upper case letters.
- lc_mask: Controls the mask character for lower case letters.
- num_mask: Controls the mask character for numbers.
Examples
{% code title="MASK example" %}
SELECT MASK('abcd-ABCD-1234')
-- xxxx-XXXX-nnnn
{% endcode %}
{% code title="MASK example containing optional arguments." %}
SELECT MASK('abcd-ABCD-1234', 'U', 'u', '#')
-- uuuu-UUUU-####
{% endcode %}
By default, upper case letters are converted to X
, lower case letters are converted to x
, and numbers are converted to n
. You can override the characters used in the mask by supplying optional arguments. The first argument controls the mask character for upper case letters, the second argument for lower case letters, and the third argument for numbers.
\