1 2 3 Previous Next 30 Replies Latest reply on Jul 18, 2018 5:04 PM by Sven W. Go to original post
      • 30. Re: Need help on wrting efficient triggers.
        Sven W.

        Mike Kutz wrote:

         

        ...

         

        Just for Reference: If you use APEX ( 5.0+ ), you would access APEX$SESSION and APP_USER

        eg

        1. coalesce(sys_context('userenv','client_identifier')--someotherapplication
        2. ,sys_context('APEX$SESSION','APP_USER')--APEX5.0+
        3. ,sys_context('userenv','session_user'))--OracleUSER(egSQL*Plus/SQL*Developer)

         

        Just for reference. This would not work well in an Apex environment. You need to switch the order of the contexts around.

         

        coalesce(sys_context('APEX$SESSION','APP_USER')--APEX5.0+
        ,sys_context('userenv','client_identifier')--someotherapplication 
        ,sys_context('userenv','session_user'))--OracleUSER(egSQL*Plus/SQL*Developer)
        

         

        Apex sets the client_identifier as APP_USER:SESSION_ID (might be the other way round). So you would always store something like "MIKE:1234567890".

        1 2 3 Previous Next