Database Reference
In-Depth Information
,'Not Harry or Joe.') = 'It is Harry!'
DECODE('Joe'
,'Harry','It is Harry!'
,'Joe','It is Joe!'
,'Not Harry or Joe.') = 'It is Joe!'
DECODE('Mary'
,'Harry','It is Harry!'
,'Joe','It is Joe!'
,'Not Harry or Joe.') = 'Not Harry or Joe.'
GREATEST(expression[, expression ...]) and LEAST(expression [,
expression ...]) . These two functions return the greatest and least val-
ues, respectively, of a list of expressions.
GREATEST('Amy', 'Joe', 'ant', 'Giant') = 'ant'
LEAST(7,12, 2, 15) = 2
NULLIF(expression, expression) . Returns a null value when both
expressions are equal. If they are not equal, the first expression is
returned.
NULLIF('blue','green') = 'blue'
NULLIF('green','green') = NULL
NVL(expression, replace) and NVL2(expression, replace, replace) .
NVL exchanges a null-valued result with a replacement value. If the
expression is not NULL, the expression is returned unchanged.
NVL2, on the other hand, will return the first replacement expression
if not NULL and the second replacement expression if NULL.
NVL('Bird','NULL was found') = 'Bird'
NVL('','NULL was found') = 'NULL was found'
NVL2('This is not NULL','Not NULL','NULL') = 'Not NULL'
NVL2('','Not NULL','NULL') = 'NULL'
USER and UID . These two functions return the Oracle username
(schema name) and unique user ID for the currently logged-in user,
respectively. These values can also be found in the USER_USERS
view and have no parameters. The first example requires that the cur-
rent session be logged in as the MUSIC user. The UID or user ID
value is very likely to be different for every session.
USER = MUSIC
UID = 101
USERENV(parameter) . Returns user session environmental settings
based on the input parameter value. This function is retained in Ora-
cle Database 10 g for backward compatibility. Parameter values are
 
Search WWH ::




Custom Search