tags:

views:

336

answers:

2

Hoping this is possible and someone can assist but I need a means of obtaining the local IP Address (Windows box listed in ipconfig command info) from within Oracle ApEx.

Is this possible as I have tried both owa_util.get_cgi_env('REMOTE_ADDR') as well as sys_context( 'userenv', 'ip_address' )

Just can't seem to get my local pc ip address within Oracle ApEx.

Any ideas?

+1  A: 

To obtain the Oracle Client IP address you have to use the one you suggested::

select sys_context('userenv','ip_address') 
  from dual;

To obtain the Oracle Server IP address you can use:

select utl_inaddr.get_host_address(sys_context('userenv','server_host')) 
  from dual;

UPDATE (from comment): If you are looking for the application server IP, nor client nor server. Right? This cannot be obtained by oracle. This is like asking oracle the web server IP. As Oracle Appex is 100% PLSQL you cannot obtain this information.

FerranB
Thanks for getting back to me. Unfortunately I have tried both of these methods but to no avail. The way the database is setup here is via a Load Balancer to determine within app server a user will connect to. I think this setup is posing a problem.
tonsils
You are looking for the application server IP?
FerranB
I am actually looking for the local PC IP on a Windows box. If you go into command window in windows and issue a ipconfig, you will see an IP Address value. It's this value I need to get to within Oracle.
tonsils
A: 

Bear in mind what your PC tells you, with ipconfig, may be a local network IP address. My home PC is assigned its address by the local router as 192.168.0.10 which would be same as ten thousand other PCs on networks around the world.

That said, see if this or this is any help.

Gary