- Non-standard alternatives available
- Only
octets - Not for national types
For character strings, SQL allows to declare whether the length means characters or octets, i.e. bytes.
CREATE TABLE … (
c1 VARCHAR(10),
c2 VARCHAR(10 CHARACTERS),
c3 VARCHAR(10 OCTETS)
)In absence of an explicit length unit, characters is default.✓✗0 The following chart shows that not all systems apply that default correctly. Note that the behavior might also depend on installation defaults, like the character encoding, so that your system might behave differently.
Charactersfor national types, depends onnls_string_unitsfor the other types- 16 bit units for national types, depends on
nls_length_semanticsfor the other types - Length limitation not enforced
- When using UTF8
- Observed with the default character set
Non-Standard Alternatives
The standard defines the keywords characters and octets (both plural) for the length units. Yet some systems support different words only.
- Not for national types
Related
- Mandatory Features
- Optional Features
- Implementation-defined Elements
Normative References
The <character length unit> was introduced with ISO/IEC 9075-2:2003 as part of the optional feature T061, “UCS support”. With the 2023 edition of the standard, it has got its own Feature ID: T062, “Character length units”.

