Home >Database >Oracle >How to convert full-width to half-width in Oracle

How to convert full-width to half-width in Oracle

WBOY
WBOYOriginal
2022-05-13 15:21:394791browse

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.

How to convert full-width to half-width in Oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to convert full-width oracle to half-width

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn