LENGTH, LENGTHB, LENGTH4
Returns the length of a given character string in an expression. LENGTH
returns type NUMBER
.
SQL syntax
{LENGTH|LENGTHB|LENGTH4} (CharExpr)
Parameters
LENGTH
has the parameter:
Parameter | Description |
---|---|
|
The string for which to return the length. Supported data types for |
Description
The LENGTH
functions return the length of CharExpr
. LENGTH
calculates the length using characters as defined by the character set. LENGTHB
uses bytes rather than characters. LENGTH4
uses UCS4 code points.
Examples
Determine the length of the string 'William'
:
Command> SELECT LENGTH('William') FROM dual; < 7 > 1 row found.
The following determines the length of the NCLOB
data:
Command> SELECT nclob_column FROM nclob_content; < Demonstration of the NCLOB data type > 1 row found. Command> SELECT LENGTH(nclob_column) FROM nclob_content; < 36 > 1 row found.