APEX tip 001: Masking & merging columns on Interactive/classic reports

Column Masking

When you want to mask sensitive data on an APEX interactive or classic report; use this on the SQL query fetching the data on your tables or views.

rpad(substr(columnName,1,5), length(columnName),'*') columnName 

SQL query example:

select CONTACT_FIRST_NAME, CONTACT_LAST_NAME, rpad(substr(CONTACT_EMAIL_ADDRESS,1,5), length(CONTACT_EMAIL_ADDRESS),'') EMAIL,rpad(substr(CONTACT_BUSINESS_PHONE,1,6), length(CONTACT_BUSINESS_PHONE),'') PhoneNo , CONTACT_CITY, CONTACT_COUNTRY from contacts_view

Results:

Merging two columns:

The above report has two columns for Name -> “Contact First Name” and “Contact Last Name”

Merge the columns using SQL query on Oracle Database; ie.

select CONTACT_FIRST_NAME || ' '|| CONTACT_LAST_NAME as NAME, rpad(substr(CONTACT_EMAIL_ADDRESS,1,5), length(CONTACT_EMAIL_ADDRESS),'') EMAIL,rpad(substr(CONTACT_BUSINESS_PHONE,1,6), length(CONTACT_BUSINESS_PHONE),'') PhoneNo , CONTACT_CITY, CONTACT_COUNTRY from contacts_view
 

Results:

Try apex using the Always Free Tier Oracle Cloud!

Cheers!

Author: Labanish

I am a Senior Cloud Solutions Architect at Oracle. Am interested in Cloud Automation, Cloud Native Applications dev and Emerging Tech. I have over 6 years work experience handling different tech roles in East Africa, Romania & now in United Kingdom. All views are mine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: