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

report

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!

About Laban Ndwaru

I am a Cloud Solutions Engineer working with a leading cloud solutions company. I have more than 5 years’ experience in the Tech ecosystem. I began my career as a software developer. I am a tech enthusiast, an autodidact whose interests includes Data Management, Cloud Native Development, Mobile and Bots Development, Integration, Low Code Development, AI, Analytics just to say the least.

View all posts by Laban Ndwaru →

Leave a Reply

avatar
  Subscribe  
Notify of