Chapter 7 SQL Data Types
265
Data type lengths of less than one are not allowed.
♦ The CHARACTER (n) alternative for CHAR is not supported in
Adaptive Server Enterprise.
♦ Adaptive Server Anywhere does not support the NCHAR and
NVARCHAR data types provided by Adaptive Server Enterprise.
CHAR data type [Character]
Character data of maximum length max-length bytes.
{ CHAR | CHARACTER } [ (
max-length
) ]
The default value of max-length is 1.
For strings up to 254 bytes in length, the storage requirement is the number
of bytes in the string plus one additional byte. For longer strings, there is
more overhead.
Strings of multi-byte characters can be held as the CHAR data type, but max-
length is in bytes, not characters.
max-length The maximum length in bytes of the string. The maximum
size allowed is 32,767.
♦
SQL/92 Compatible with SQL/92.
♦
Sybase Compatible with Adaptive Server Enterprise. In Adaptive
Server Enterprise, the storage requirements for CHAR data types is
always max-length. The maximum max-length for ASE is 255.
♦
Other database systems In many other database-management
systems, unlike Adaptive Server Anywhere,CHAR data types require
max-length bytes of storage, regardless of the length of the actual string.
"CHARACTER VARYING data type" on page 265
"LONG VARCHAR data type" on page 266
CHARACTER VARYING data type [Character]
Same as CHAR.
{ VARCHAR | CHARACTER VARYING } [ (
max-length
) ]
The default value of max-length is 1.
Notes
Compatibility
Function
Syntax
Usage
Parameters
Standards and
compatibility
See also
Function
Syntax
Usage