Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle LENGTH Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

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      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 317 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?