MASK_NUMERIC is similar to MASK_HASH except output is masked as numbers. You can specify length and use hashing algorithms like MD5, SHA‌-1, SHA‌-256.

Syntax

/*+  MASK_NUMERIC(column, length [ , 'type']) */

Arguments

  • column - name of table column.
  • length - length of mask.
  • type - MD5, SHA‌-1, SHA‌-256. Put this in single quotation marks.

Additional Information

  • MASK_NUMERIC raises an exception if the numeric field contains nulls.

Examples

SELECT MASK_NUMERIC(email, 8, 'SHA-1'), * FROM widgetcorp.sales.accounts.customers;

| RESULTS | id |  name | surname | email |
|---|---|---|---|---|
| 44591468 | 39772 | eddie | gaff | egaff@lapd2019.gov |
| 11879666 | 23381 | holden | holden.d@turtle.com |
| 34920646 | 26354 | deckard | rick@unicorn.co |

SELECT MASK_NUMERIC(id, 5), * FROM widgetcorp.sales.accounts.customers;

| RESULTS | id |  name | surname | email |
|---|---|---|---|---|
| 30150 | 39772 | eddie | gaff | egaff@lapd2019.gov |
| 22444 | 23381 | holden | holden.d@turtle.com |
| 29751 | 26354 | deckard | rick@unicorn.co |