How to obtain IP address from program?

Question:

>We are using Oracle 8i and Oracle Forms 6.0.  Is there a way to obtain
>the IP Address of the machine that Oracle Forms is running on via an
>Oracle function, etc...?
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

Answer:

As long as they use "user/pass@DATABASE" to connect (and sqlnet for tcp/ip) --
yes.

$ sqlplus scott/tiger@ora8idev

SQL*Plus: Release 8.1.5.0.0 - Production on Mon Jan 24 14:28:47 2000
(c) Copyright 1999 Oracle Corporation.  All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production

scott@dev8i> select sys_context( 'userenv', 'ip_address' ) from dual;

SYS_CONTEXT('USERENV','IP_ADDRESS')
----------------------------------------------------------------------------------------------------
138.2.5.52
 

NOTE: sys_context is available with 8i release 8.1 and later.  In 8.0 and before
you can enable connecting auditing to achieve a similar effect without the
sys_context function.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   [email protected]
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation

Hosted by www.Geocities.ws

1