Handling Unicode

If the underlying database column is stored in the database as Unicode, LANSA will automatically create or reuse an appropriate field along the following guidelines:

Other Files with SUNI Fields

When an existing Other File contains fields which have the SUNI attribute, you may wish to re-load the file and its fields to use Nchar and Nvarchar. To do this, you need to remove all Char and String fields with the SUNI attribute from the file, and then reload the file.

Here's an example of how to do this. You can modify these instructions to suit your own needs:

Prepare for the change

1.  Check out the file and its fields that have the SUNI attribute.

2.  Create new fields that are copies of any SUNI fields on the file. These can be deleted later if not required.

3.  Create a new list that contains the SUNI fields and all objects that use the fields, as well as the new copied fields. Save this list to Excel.

4.  Make note of any *WEBEVENT functions that use SUNI fields in DISPLAY, REQUEST or POP_UP commands.

5.  Check out all the objects that use the fields.

6.  Print the file definition.

7.  Delete the SUNI fields from the file.

8.  Delete the SUNI fields from the repository.

Reload file creating new fields

1.  Reload the file. It should now have Nchar or Nvarchar fields replacing the original SUNI fields.

2.  Update the new fields with rules and triggers, multilingual descriptions, etc from the original fields: information will have been saved when you copied the original fields earlier.

3.  If any SUNI fields were used in DISPLAY, REQUEST or POP_UP commands in *WEBEVENT functions, you will need to continue to use SUNI fields here. The simplest technique is to take the copied field and copy it back to the original identifier, and then use this as a virtual field on the file. Remember that data loss may occur when Unicode field types are assigned to SUNI fields unless all data is known to be in the current code page.

Finish the conversion

1.  There is no guarantee that newly created fields will use the same identifier as the old field. If the identifiers are different, and the field is used outside of the file definition, there are two options:


2.  Rebuild the OAM and the objects that use the field, and re-test functionality.

3.  Check everything back in.