- Categories:
REGR_VALX¶
Returns NULL if the first argument is NULL; otherwise, returns the second argument.
Note that REGR_VALX is a NULL-preserving function, while the more commonly-used NVL is a NULL-replacing function.
Syntax¶
Arguments¶
y:An expression that evaluates to type FLOAT or DECFLOAT or that can be cast to type FLOAT or DECFLOAT.
x:An expression that evaluates to type FLOAT or DECFLOAT or that can be cast to type FLOAT or DECFLOAT.
Important
Note the order of the arguments; y precedes x.
Returns¶
If any of the input expressions is of type DECFLOAT, the returned type is DECFLOAT. Otherwise, the returned type is FLOAT.
Examples¶
Basic example:
This example is similar to the preceding example, but shows more clearly that the convention is to pass the Y
value first. It also shows the difference between REGR_VALX and REGR_VALY: