Progress
SQL-92
Guide and Reference


Character Data Types

This is the syntax for a char_data_type:

SYNTAX
{ CHARACTER | CHAR } [ ( length ) ] 
  | { CHARACTER VARYING | CHAR VARYING | VARCHAR } [ ( length ) ]  

CHARACTER [ ( length ) ]

CHARACTER (alias CHAR) corresponds to a null-terminated character string with the length specified. Values are padded with blanks to the specified length. The default length is 1. The maximum length is 2000 characters.

The Progress SQL-92 representation is a variable-length string. The host language representation is equivalent to a C Language character string.

{ CHARACTER VARYING | CHAR VARYING | VARCHAR } [ ( length ) ]

CHARACTER VARYING, CHAR VARYING, and VARCHAR corresponds to variable-length character string with the maximum length specified. The default length is 1 character. The maximum length is 31995 characters.

NOTES

Maximum length for VARCHAR

Specifically, the maximum length or maximum number of character for the VARCHAR data type is:

The maximum length of the VARCHAR data type depends on:

See the "Character-String Literals" section for details on specifying values to be stored in CHARACTER columns.

National Language Support (NLS)

The VARCHAR data type has NLS. The choice of character set affects the available character count or maximum length of the data column. The limits established above assume a single byte character set. Using a multiple byte character set lowers the maximum character count proportionally. For example, if all the characters in a character set take 3 bytes per character, in Version 9 the practical maximum is 10660 (31982 divided by 3). If, however, you are using a variable width character set, you will be able to hold between 10660 and 31982 characters depending on the actual mix of characters you use.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095