A script-enabled browser is required for this page to function properly.

Length Function Returns NULL for Zero-Length Strings

In PL/SQL V1, the LENGTH function applied to a null expression resolves to zero. In versions after V1, the LENGTH function applied to a null expression resolves to null.

To preserve V1 behavior, the PL/SQL conversion utility adds the NVL SQL predicate to ensure that the LENGTH function applied to a null expression resolves to zero.

Length function Example

The conversion utility converts this PL/SQL V1 code:

c:=null;
l=LENGTH( c ); In V1, this resolves to 0

. . . to this:

c:=null;
l=NVL(LENGTH( c ),0); Converter wraps LENGTH function
with NVL( ) Built-in, forcing the
expression to resolve to 0


About the PL/SQL V1 conversion utility