if you are looking for "dynamic data masking", then Oracle provides a licensed feature using DBMS_REDACT package.
There are other alternatives that you can look at:
Or third party software.
For STATIC data masking (which is a storage level permanent value change), example:
CREATE TABLE scrambled
INSERT INTO scrambled (date_of_birth, first_name, postcode)
SELECT SYSDATE - DBMS_RANDOM.VALUE (1,366),
DBMS_RANDOM.STRING ('U', 20),
LPAD (CEIL (DBMS_RANDOM.VALUE (1,99999999)), 8, '0')
CONNECT BY LEVEL <= 10 ;
Thank you for the response, Emad.
Our requirement is to write a function and then pass the table name and column names as variables to mask the SSN value. Would you have an example for this scenario?
Sounds like a requirement I might question. SSN should be encrypted at the very least. I would also look at limiting the number of tables that have this data.
Maybe I'm reading more into the question than is there, but based on the wording it almost sound like SSN is being stored as clear text. I'd be looking at Oracle Advanced Security.