SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
Host Variables in C/C++ Programs
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
3-3
Character Host Variables
variables with the KANJI or KSC5601 character set in an SQL/MX application only
to access KANJI or KSC5601 columns in an SQL/MP table.
C-identifier specifies that the variable can hold a fixed-length character (or
code_units) string. The maximum length of the string is specified in the length
field.
The length l + 1 is required and must be enclosed in square brackets. The length
l corresponds to the length of the column value. To allow for the null terminator,
add 1 to the length for the declaration of the host variable.
C-initial-value is a valid string literal in C/C++. The initial value should be of
the same type as the C array type translated by the SQL/MX preprocessor.
NCHAR C-identifier [l +1] [C-initial-value] [,...]
specifies the data type of a target host variable for a column with data in the pre-
defined national character set of this SQL data type:
NCHAR(1)
C -identifier specifies that the variable can hold a fixed-length character (or
code_units) string. The maximum length of the string is specified in the length
field.
The length l + 1 is required and must be enclosed in square brackets. The length
l corresponds to the length of the column value. To allow for the null terminator,
add one (1) to the length for the declaration of the host variable.
NCHAR is always associated with the system default NATIONAL_CHARSET. For
information on setting NATIONAL_CHARSET, see the SQL/MX Reference Manual.
C-initial-value is a valid string literal in C/C++. The initial value should be of
the same type as the C array type translated by the SQL/MX preprocessor.
VARCHAR [char-set] C-identifier [l + 1] [C-initial-value] [,...]
specifies the data type of a target host variable for a column of this SQL data type:
VARCHAR(l)
char-set is specified as CHARACTER SET [IS] character-set-name. This
optional clause specifies the character set to be associated with the host variable.
If no char-set is specified, the default character set for VARCHAR is ISO88591.
char-set can be ISO88591, UCS2, KANJI, KSC5601. Note that host variables
with the KANJI or KSC5601 character set in an SQL/MX application can be used
only to access KANJI or KSC5601 columns in an SQL/MP table.
C-identifier specifies that the variable can hold a variable-length character (or
code_units) string. The maximum length of the string is specified in the length
field.