1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to Track the Computer Name who modified the APEX Pages

Discussion in 'Oracle Application Express (APEX)' started by Bharat, Jun 22, 2015.

  1. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi All,

    As we have only one user access to development instance, more than one user is logging to APEX at a time and doing modifications on the Pages. Here the requirement is to track the system name who logs in to the APEX and modified the Pages. Is this possible to track the system name who logs in to the APEX and modifies the pages.
     
  2. DTSIGuy

    DTSIGuy Forum Advisor

    Messages:
    402
    Likes Received:
    58
    Trophy Points:
    410
    Location:
    Texas
    Yes it is...

    I have a field on one of my apps to capture the Computer Name of the PC using a PL/SQL Function Body.

    Here's the code I use:


    Code (SQL):
    DECLARE
       me     varchar2(25);
       me2    varchar2(100);
       no_pc  exception;              -- In the event the host name is not there
       no_acl exception;              -- In the event the access is denied
       pragma exception_init(no_pc, -29257);
       pragma exception_init(no_acl, -24247);
    BEGIN
       SELECT owa_util.get_cgi_env('REMOTE_ADDR') INTO me FROM dual;
       SELECT utl_inaddr.get_host_name(me) INTO me2 FROM dual;
       RETURN UPPER(substr(me2, 1, (instr(me2, '.') - 1)));
    exception
       WHEN no_pc THEN
          NULL;
    END;
     


    HOWEVER...you may have to GOOGLE the use of owa_util.get_cgi_env to get it to work. Seems to have different requirements based on the server O/S that APEX is running from and/or some config of the APEX listener. The above works just fine for me and if I install APEX on my personal laptop (Windows 7 based) it still works for me.

    HTH

    CJ
     
    Muhammad Uzair likes this.