The TO_SINGLE_BYTE function returns a string in which multi-byte characters are converted to the equivalent single-byte character where an equivalent character exists.
The schema is SYSIBM.
Only characters that have an equivalent to the single-byte characters represented by the characters in the UTF-8 code point range U+0020 to U+007E will be converted. If a multi-byte character does not have a single-byte equivalent, then it remains unchanged.
This function is only supported for database created in unicode and IBM-943 code page (SQLCODE 42997).
The data type, code page and length attribute of the result is the same as the data type, code page and length attribute of the argument. If the argument can be null, the result can be null. If the argument is null, the result is the null value.
Convert the full width UTF-8 characters 'ABC' (x'efbca1efbca2efbca3' in hex format) to their single byte equivalents.
VALUES TO_SINGLE_BYTE(x'efbca1efbca2efbca3')
The result is the value 'ABC' (x'414243' in hex format).