Oracle has a very useful built-in function called SYS_CONTEXT. The syntax of this function goes like this:
SYS_CONTEXT ( 'namespace' , 'parameter' [, length] )
SYS_CONTEXT returns the value of parameter associated with the context namespace. You can use this function in both SQL and PL/SQL statements.
What makes this function more interesting is the fact that Oracle provides a built-in namespace called USERENV with predefined parameters, which describes the current session. Go ahead and run the following query: Continue reading…