SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Migrating SQL/MX Release 1.8 Applications to
SQL/MX Release 2.x
HP NonStop SQL/MX Database and Application Migration Guide540435-005
7-6
KANJI and KSC5601 Character Data
Effect of the New Behavior on SQL/MX Applications
If you preprocess an SQL/MX Release 1.8 application that uses INVOKE to create a
date-time or interval host variable, SQL/MX Release 2.x returns an error during SQL
compilation. The CAST function in an SQL/MX Release application is incompatible with
the SQL:1999 date-time host variables created by INVOKE in SQL/MX Release 2.x.
Retaining SQL/MX Release 1.8 INVOKE Behavior
If your SQL/MX Release 1.8 application uses INVOKE to create a date-time or interval
host variable and you plan to preprocess the application in SQL/MX Release 2.x, use
the
-e preprocessor option. For more information, see the SQL/MX Programming
Manual for C and COBOL.
KANJI and KSC5601 Character Data
You must explicitly preprocess and compile any SQL/MX Release 1.8 C, C++, and
COBOL application that uses character data associated with the KANJI or KSC5601
character set when you migrate it to run in an SQL/MX Release 2.x environment.
SQL/MX Release 1.8 and SQL/MX Release 2.x interpret byte lengths for double
byte-encoded character sets, such as KANJI and KSC5601, differently.
SQL/MX Release 1.8 makes no distinction between single byte-encoded and
double byte-encoded character data, so one character is always treated as being
one byte in length. SQL/MX 2.x uses the wide character type designation
(
wchar_t) to distinguish double byte-encoded character data from regular width
character data.
SQL/MX Release 1.8 defines character length on byte boundaries, whereas
SQL/MX Release 2.x defines character length on character boundaries.
In SQL/MX Release 1.8 applications, host variable declarations and string literals for
KANJI and KSC5601 character data can be misinterpreted by SQL/MX Release 2.x,
causing character arrays to be overwritten. For example, an SQL/MX Release 1.8 host
variable declaration of char[10] for double-byte character data means the character
data is 10 bytes long, but SQL/MX Release 2.x interprets and compiles the char[10]
host variable as character data that is 10 two-byte characters long (20 bytes long). As
a result, the character data is twice as long for SQL/MX Release 2.x. If the host
variable is intended for output, SQL/MX Release 2.x might overwrite the character
array in the SQL/MX Release 1.8 application, causing data corruption.
Note. This issue affects only SQL/MX Release 1.8 applications preprocessed by SQL/MX
Release 2.x. Previously compiled SQL/MX Release 1.8 applications continue to run correctly
without changes in SQL/MX Release 2.x.
Caution. If you do not explicitly language-compile the affected application, data corruption or
application failure might occur.