Monday, October 13, 2008

To know the IP adrees of Client in Oracle

SYS_CONTEXT returns the value of parameter associated with the context namespace. You can use this function in both SQL and PL/SQL statements.For namespace and parameter, you can specify either a string or an expression that resolves to a string designating a namespace or an attribute.

The datatype of the return value is VARCHAR2. The default maximum size of the return value is 256 bytes. You can override this default by specifying the optional length parameter, which must be a NUMBER or a value that can be implicitly converted to NUMBER. The valid range of values is 1 to 4000 bytes.

Examples
CONNECT OE/OE
SELECT SYS_CONTEXT ('USERENV', 'SESSION_USER') FROM DUAL;
SYS_CONTEXT ('USERENV', 'SESSION_USER')
------------------------------------------------------
OE

SELECT SYS_CONTEXT ('USERENV', 'IP_ADDRESS') FROM DUAL;

No comments:

search engine

Custom Search