In Oracle, you can use "TO_SINGLE_BYTE(String)" to convert full-width to half-width; the "TO_SINGLE_BYTE" function can replace all multi-byte characters in the parameters with equivalent single-byte characters, only when Valid when the database character set contains both multi-byte and single-byte characters.
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
TO_SINGLE_BYTE
Syntax: TO_SINGLE_BYTE(String)
Function: Calculate all multi-words in String section characters are replaced with equivalent single-byte characters. This function only works when the database character set also contains multi-byte characters. It is valid when using single-byte characters. Otherwise, String will not be processed in any way. That is, half-width characters in the string will be converted into full-width characters
Return: String
Examples are as follows:
SQL> select to_multi_byte('半角转全角:123test') from dual; TO_MULTI_BYTE('半角转全角:123T ------------------------------ 半角转全角:123test SQL>
SQL> select to_multi_byte('高A') text from dual; test ---- 高A
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to convert full-width to half-width in Oracle. For more information, please follow other related articles on the PHP Chinese website!