Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Length of empty string?
Because a zero-length string is equal to NULL under Oracle.
Many functions return NULL when their parameter is NULL and
a "normal" (numeric, string or date) value in other cases.
length (NULL) = length ('') ==> NULL
If you desesperately want a numeric result you can use the built-in function NVL (Expr, ReturnValueIfNull). It return Expr if Expr is not NULL or the other parameter in the other case: select NVL (length (YourString), 0) from dual;
This way you will get back the good length of the string.
Regards.
Denis.
Roy Smith a écrit dans le message ...
|Why does length() return nothing (instead of the number zero) on an
|zero-length string?
Received on Fri May 01 1998 - 10:42:05 CDT
![]() |
![]() |