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

PL/SQL conversion utility:   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.

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)

See also

About the PL/SQL conversion utility