totn Oracle Functions

Oracle / PLSQL: LENGTH4 Function

This Oracle tutorial explains how to use the Oracle/PLSQL LENGTH4 function with syntax and examples.

Description

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

Syntax

The syntax for the LENGTH4 function in Oracle/PLSQL is:

LENGTH4( string1 )

Parameters or Arguments

string1
The string to return the length for. It can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2, but it can not be CLOB or NCLOB.

Returns

The LENGTH4 function returns a numeric value.
If string1 is NULL, then the LENGTH4 function will return NULL.

Applies To

The LENGTH4 function can be used in the following versions of Oracle/PLSQL:

  • Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let's look at some Oracle LENGTH4 function examples and explore how to use the LENGTH4 function in Oracle/PLSQL.

For example:

LENGTH4(NULL)
Result: NULL

LENGTH4('')
Result: NULL

LENGTH4(' ')
Result: 1

LENGTH4('TechOnTheNet.com')
Result: 16

LENGTH4('TechOnTheNet.com ')
Result: 17