Oracle9i SQL Reference Release 1 (9.0.1) Part Number A90125-01 |
|
Functions, 60 of 166
length::=
length
The length functions return the length of char. LENGTH
calculates length using characters as defined by the input character set. LENGTHB
uses bytes instead of characters. LENGTHC
uses unicode complete characters. LENGTH2
uses UCS2 codepoints. LENGTH4
uses UCS4 codepoints..
char can be any of the datatypes CHAR
, VARCHAR2
, NCHAR
, NVARCHAR2
, CLOB
, or NCLOB
. The return value is of datatype NUMBER
. If char has datatype CHAR
, the length includes all trailing blanks. If char is null, this function returns null.
The following examples use the LENGTH
function using single- and multibyte database character set.
SELECT LENGTH('CANDIDE') "Length in characters" FROM DUAL; Length in characters -------------------- 7
This example assumes a double-byte database character set.
SELECT LENGTHB ('CANDIDE') "Length in bytes" FROM DUAL; Length in bytes --------------- 14
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|