Quick Search:
 
 The Oracle LENGTH Function      [Return To Index] Jump to:  

Term: LENGTH

Definition:
The Oracle PL/SQL LENGTH function returns the length of the specified string. It calculates the length using characters as defined by the input character set. The return value the LENGTH function is always of the datatype NUMBER.

Example Syntax:

LENGTH( string )


string is the string of characters to find the length of. The input string can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. If string is NULL or empty, then the LENGTH function returns NULL.


Example Usage:

SELECT LENGTH('Oracle functions') "String length in characters"
FROM DUAL;

String length in characters
--------------------
16



Notes:
  1. If string is of the datatype CHAR, then the length includes all trailing blanks.
  2. LENGTHB uses bytes instead of characters to compute the length.
  3. LENGTHC uses Unicode characters to compute the length.
  4. LENGTH2 uses UCS2 code points to compute the length.
  5. LENGTH4 uses UCS4 code points to compute the length.


Related Links:

Related Code Snippets:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org