Home > Database > Oracle > body text

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

WBOY
Release: 2022-05-13 15:21:39
Original
4706 people have browsed it

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>
Copy after login
SQL> select to_multi_byte('高A') text from dual;
 
test
----
高A
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template