Considerations For Character String Data Types - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

PIC[TURE] X[(length)] [DISPLAY] [char-set] [collate-clause] [UPSHIFT]
specifies a column with fixed-length character data.
You can specify the number of characters in a PIC X column by specify either length or
multiple Xs, with each X representing one character position. DISPLAY does not change the
meaning of the clause.
PIC is a Neoview SQL extension.
CHAR[ACTER] VARYING (length) [CHARACTERS] [char-set]
specifies a column with varying-length character data. VARYING specifies that the number
of characters stored in the column can be fewer than the length.
Note that values in a column declared as VARYING can be logically and physically shorter
than the maximum length, but the maximum internal size of a VARYING column is actually
four characters larger than the size required for an equivalent column that is not VARYING.
VARCHAR (length) [char-set]
specifies a column with varying-length character data.
VARCHAR is equivalent to data type CHAR[ACTER] VARYING.
NCHAR [(length)] NATIONAL CHAR[ACTER] [(length)]
specifies a column with data in the pre-defined national character set.
NCHAR VARYING [(length)] NATIONAL CHAR[ACTER] VARYING (length)
specifies a column with varying-length data in the pre-defined national character set.

Considerations for Character String Data Types

Difference Between CHAR and VARCHAR
You can specify a fixed-length character column as CHAR(n), where n is the number of characters
you want to store. However, if you store five characters into a column specified as CHAR(10),
ten characters are stored where the rightmost five characters are blank.
If you do not want to have blanks added to your character string, you can specify a variable-length
character column as VARCHAR(n), where n is the maximum number of characters you want to
store. If you store five characters in a column specified as VARCHAR(10), only the five characters
are stored logically—without blank padding.
Maximum Byte Length of a Character Column
Data Type
Fixed-length
Variable-length
1
The maximum row size is 32708 bytes, but the actual row size is less than that because of bytes used by the header,
null indicator, column length indicator, and other system features.
Character Sets
For Neoview SQL, a character data type can be associated only with the DEFAULT collation.
You set the default NCHAR data type and you can select from the ISO88591 or UCS2. If you do
not make a selection, the default is UCS2.
NOTE:
If you attempt to create a Neoview SQL table with unsupported character set types, an
SQL error is returned and the operation fails.
For more information, see
NCHAR Columns in SQL Tables
Key-Sequenced
1
32708
1
32708
*
"Character Sets" (page 190)
Entry-Sequenced
Not applicable
Not applicable
and
"Database Object Names" (page
196).
Data Types
201

Advertisement

Table of Contents
loading

Table of Contents