Oracle String/Char Function - Oracle/PLSQL LENGTH4 Function






This Oracle tutorial explains how to use the Oracle/PLSQL LENGTH4 function.

The Oracle/PLSQL LENGTH4 function returns the length of a string using UCS4 code points.

Syntax

The syntax for the Oracle/PLSQL LENGTH4 function is:

LENGTH4( string1 )

string1 is the string to calculate the length. string1 can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2.

string1 can not be CLOB or NCLOB.

If string1 is NULL, LENGTH4 returns NULL.

Example

LENGTH4(NULL)
-------------
        NULL
 
 LENGTH4('')
------------
        NULL
 
 LENGTH4(' ')
------------
           1
 
 LENGTH4('java2s.com')
----------------------
                   16