LENGTHC is one of the vital string/char functions of Oracle. It is used to get the length of a string, same as the LENGTHB function with the only difference that it uses the UNICODE complete characters. The LENGTHC function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i and Oracle 8i.
Syntax:
LENGTHC ( string )
Parameters:
string: It is used to specify the string whose length needs to get.
Example:
LENGTHC (NULL) |
Output:
NULL
Explanation:
There is no string passed hence the result is NULL.
Example 2:
LENGTHC (‘’) |
Output:
NULL
Explanation:
There is no string passed hence the result is NULL.
Example 3:
LENGTHC (‘ ’) |
Output:
1
Explanation:
The SPACE is passed as a string, hence the result is 1.
Example 4:
LENGTHC (‘HELLOWORLD.COM’) |
Output:
14
Explanation:
The total number of characters including the ‘.’ is 14 and so is the result..