NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-11
Character Expressions
The maximum length of a character column depends on whether the data type is fixed-
length or variable-length, whether the associated character set is single-byte or double-
byte, and on the file organization of the file that contains the column:
Each variable-length character data item requires two bytes of storage for length
information, in addition to the space required for the data itself. As a result, the
maximum length for a variable-length column is less than the maximum length for an
otherwise equivalent fixed-length column.
A column that allows null values requires two extra bytes.
A string literal can be as long as a character column.
Note that C string data types require an additional trailing null character. Due to this
additional null character, using C string data types disables the SQL bulk move feature
when you move contiguous data fields between the Executor Extended Data Segment
and program host variables.
Character Expressions
A character expression specifies a value and can be a simple string literal or a column
name that specifies the value of a column in a row of a table. The expression can include
string operators and function calls that return string results. All of the following are
character expressions:
A character expression has a CHAR or VARCHAR data type and can be upshifted.
Data Type Key-Sequenced Relative or Entry-Sequenced
Single-byte unvarying 4061 4072
Single-byte VARYING 4059 4070
Double-byte unvarying 2030 2036
Double-byte
VAR Y I NG
2029 2035
ABILENE” A character string
CUSTNAME The value in column CUSTNAME
SUBSTRING (“Robert” FROM 0 FOR
3)
The SUBSTRING function applied to the string
“Robert”