This article explains how to use Level 49 Unicode host variables and parameters.
Problem:
Using a relational database within Microsoft SQL SERVER 2008 where table columns are defined as NVARCHAR. In order to read and to update these columns it should be possible to define and to use these columns as well. How can SQL datatype NVARCHAR be used?
Resolution:
Net Express 5.1 WebSync4: Beginning with that WebSync4 it is now possible to define and to use those host variables correctly as the following:
01 NVARCHARFIELD.
49 NVARCHARFIELD-L PIC S9(4) COMP-5.
49 NVARCHARFIELD-V PIC N(100) USAGE NATIONAL.
Use Level 49 for VARCHARs
By default, OpenESQL Assistant generates a host variable as a PIC X(n) field for VARCHAR columns. When data is mapped to the host variable, it is null terminated. However, you can set OpenESQL Assistant to generate the host variable with two level-49 variables; one for the length of the data mapped and one for the actual text data.
To enable Level 49 for VARCHARs it is recommended to check the box in DCLGEN options under Net Express IDE > Options > Embedded SQL… > OpenESQL Assistant Configuration options.
For more information refer to: Net Express Help Topics > Content > Programming > Database Access > Database Access Guide > Part2:OpenESQL > 7:OpenESQL > Unicode Support in OpenESQL.
Incident Number: 2278179