DBMS_REDACT
Hello,
We're implementing data masking for certain fields in database with varying patterns. One of the varchar2 fields in a table can have all Characters, Alphanumeric, or Numbers. We're written the REGEXP_REPLACE for that:SELECT name, REGEXP_REPLACE (name,
'(.*)([^[:alpha:]]{4})',
'********\2',
1,
0,
'i') FROM my_table; Original Value | Redacted Value
=================================================
All Chars : Ambikesh Pagare | Ambikesh Pagare
All Numbers : 0100022749513 | ********9513
Alphanumeric : CIB001 005 1234 | ********1234
The query provides the right results, however when the same expression is given on the REDACT POLICY, the all characters return null in the redacted column.