How can i show data of a username (with same role) - APEX

128 Views Asked by At

I am using Apex Application, I need to show data depending on the username that is logged in. I have created roles, but I want to only show the data depending on the patient. For example: A patient wants to see his personal data and not all the data of other patients, is this possible to do with PL/SQL?

1

There are 1 best solutions below

0
On

You can use the variable APP_USER for that. It contains the username of the logged on user. If the page is public then APP_USER will have value "nobody". Example:

SELECT <columns> 
  FROM <table> 
 WHERE username = :APP_USER;

Note that for sensitive data you might want to look at more robust ways of security your data, like VPD. That also can be used with apex. Rgds Koen