Functions

Contact Us or call 1-877-932-8228
Functions

Functions

To test a function within a SQL query, use the DUAL table and supply the function name in the SELECT clause of the query.

SELECT <function call> FROM dual;

The SYS_CONTEXT function returns the value of a supplied parameter related to the context namespace. It can be used to retrieve information about the user's environment using the USERENV namespace. It also can be used to retrieve application specific data by using user defined context namespaces.

Code Sample:

Pseudo-Columns-and-Functions/Demos/select_from_dual.sql
SELECT sys_context('USERENV' , 'SESSION_USER') 
FROM dual;

This example returns the name of the current user using the sys_context FUNCTION. It demonstrates the typical use of the dual table as well as one example of how SYS_CONTEXT can be called.

Next