Purpose
You can call this function to convert all multi-byte characters into the corresponding single-byte characters. This function is valid only when your database character set contains both single-byte and multi-byte characters.
Syntax
TO_SINGLE_BYTE(char)
Parameters
char can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2. If a multi-byte character in char does not have a single-byte equivalent, the multi-byte character is displayed in the output character string.
Return types
This function returns the same value type as char.
Examples
Convert the multi-byte B in UTF8 to the corresponding single-byte B in ASCII.
obclient> SELECT TO_SINGLE_BYTE(CHR(15711394)) FROM DUAL; +-------------------------------+ TO_SINGLE_BYTE(CHR(15711394)) +-------------------------------+ B +-------------------------------+ 1 row in setConvert a full-width character in a string into a half-width character.
obclient> SELECT TO_SINGLE_BYTE('A') text FROM DUAL; +---------+ TEXT +---------+ A +---------+ 1 row in set