MASK_CC masks all but the last 4 digits of a standard 16 digit credit card number.

Syntax

/*+  MASK_CC(column) */

Arguments

  • column - name of table column.

Examples

SELECT MASK_CC(ccard), * FROM widgets.sales.accounts.ccards

| RESULTS | id | type | ccard |
|---|---|---|---|---|
| XXXXXXXXXXXX4444 | 39772 | mastercard | 5555555555554444 |
| XXXX-XXXX-XXXX-1111 | 23381 | visa | 4111-1111-1111-1111 |
| XXXXXXXXXXX0005 | 26354 | amex | 378282246310005 |