CCSID of dynamic SQL statements
An SQL statement is normally a host variable. The coded character set identifier (CCSID) of the host variable is used as the CCSID of the statement text.
Dynamic SQL statements are processed using the CCSID of the statement text. This affects variant characters. For example, the not sign (¬) is located at 'BA'X in CCSID 500. This means that if the CCSID of your statement text is 500, SQL expects the not sign (¬) to be represented by the value 'BA'X.
If the statement text 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.
Parent topic:
Dynamic SQL applications