IBM Support

Allow UTF-8 source for SQL precompiles

News


Abstract

The SQL precompiler accepts source that is UTF-8 (CCSID 1208).

Content

 You are in: IBM i Technology Updates > Db2 for i - Technology UpdatesDb2 for i Functional Enhancements > Allow UTF-8 source for SQL precompiles

Source file CCSIDs in the SQL precompiler

For a UTF-8 source stream file (CCSID 1208), the SQL precompiler uses the CCSID provided by the Conversion CCSID (CVTCCSID) parameter on the precompile command. The CVTCCSID parameter must identify a valid single-byte or mixed-byte EBCDIC CCSID. The SQL precompiler converts the UTF-8 source to the CVTCCSID and then considers the CCSID of the primary source to be the CVTCCSID value instead of UTF-8.

When processing SQL INCLUDE statements, the include source is converted to the CCSID of the primary source if necessary. If the include source cannot be converted to the CCSID of the primary source, an error occurs.

The SQL precompiler processes SQL statements using the source CCSID. This affects variant characters the most. For example, the not sign (¬) is located at 'BA'X in CCSID 500. This means that if the CCSID of your source file is 500, SQL expects the not sign (¬) to be located at 'BA'X.

If the source file CCSID is 65535, SQL processes variant characters as if they had a CCSID of 37. This means that SQL looks for the not sign (¬) at '5F'X.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"IBM i 7.4;IBM i 7.3","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
13 January 2020

UID

ibm11115691