Oracle VPD - pre SQL statement

Hi all,

is it possible to use the Oracle VPD with easymorph?
https://docs.oracle.com/database/121/DBSEG/vpd.htm#DBSEG007

I need to fire the following query, before accessing the secured object, as the Oracle Database need the user I am simulating:

/
begin
DBMS_SESSION.SET_IDENTIFIER (‘relevant username’);
end;
/

It didn’t work for me in a combined Custom SQL statement.
Ideas and hints are welcome!

Thanks
Daniel

Beginner mistake?!

I solved it with the following steps:
image

Is this the best approach?

Thanks,
Daniel

If it didn’t work in a combined custom SQL query (which should’ve been the correct way), it’s not clear why it worked this way.

Hi,

You may also use proxy user property (better managed in last version of Easymorph) and use in your oracle VPD function : SYS_CONTEXT(‘USERENV’,‘PROXY_USER’)

Maybe easier and more transparent.

Regards