Purpose
This function converts all multibyte characters to their corresponding single-byte characters. This function is effective only when your database character set contains both single-byte and multibyte characters.
Syntax
TO_SINGLE_BYTE(char)
Parameters
The char data type can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2. If any multibyte character in char has no single-byte equivalent, the output string displays the character as a multibyte character.
Return type
The return value is of the same data type as char.
Examples
Converts each multi-byte B value from the UTF-8 character set to the corresponding single-byte B value in the ASCII character set.
obclient> SELECT TO_SINGLE_BYTE(CHR(15711394)) FROM DUAL; +-------------------------------+ | TO_SINGLE_BYTE(CHR(15711394)) | +-------------------------------+ | B | +-------------------------------+ 1 row in setConverts full-width characters to half-width characters in a string.
obclient> SELECT TO_SINGLE_BYTE('China A') text FROM DUAL; +---------+ | TEXT | +---------+ | China A | +---------+ 1 row in set