Load and unload through nzload and external tables

You can use the nzload command to load national character set data. The source dataobject must contain char-class data in Latin-9 and nchar-class data in correct UTF-8 encoding. For the nzload command, you use the -encoding option to specify the type of data in the file. The -encoding option has three values:
  • The default value ‘internal’ indicates that the file can have either or both Latin-9 and UTF-8 data by using any or all of the char, varchar, nchar, or nvarchar data types. As a best practice, Performance Server recommends that you always use ‘internal’.
  • A value of ‘latin9’ indicates that the whole file is in Latin-9 char/varchar data and has no nchar/nvarchar data. If the file contains any nchar/nvarchar data, it is rejected by the load operation.
  • A value of ‘utf8’ indicates that the whole file is in UTF-8 encoding and has only nchar/nvarchar data and no char/varchar data. If the file contains any char/varchar data, it is rejected by the load operation.
You can also use the CREATE EXTERNAL TABLE command to load and unload national character set data. The source dataobject must contain char-class data in Latin-9 and nchar-class data in correct UTF-8 encoding. The CREATE EXTERNAL TABLE command uses the same -encoding option and values as the nzload command to identify the content of the file.
CREATE EXTERNAL TABLE xTBL SAMEAS TBL USING (dataobject 
('/tmp/TBL.data') delimiter '|' encoding 'internal');

If a table definition contains either or both Latin-9 and UTF-8 char/varchar and nchar/nvarchar data, make sure that you specify the encoding as 'INTERNAL'. Also, load and unload by using external tables does not do any code set conversions. If your data is in a legacy format and needs to be converted to UTF-8, use the nzconvert command.

During loading, the system verifies that the UTF-8 data is correctly encoded, which means that a Unicode value is represented in the smallest possible number of bytes, that values do not exceed the maximum length of four UTF-8 bytes, and that the character sequences are formed. The system also verifies that the data does not include any disallowed characters.

Unloading to an external table copies unmodified column data to the dataobject of the external table.