Get the App
SLTechnology News&Howtos  ›  Database  › 

How to judge whether a string contains Chinese characters in oracle

Shulou Source: shulou.com Published: 2022-06-01 17:24:56 09月29日 Update

How to judge whether a string contains Chinese characters in oracle

1. 1 BLOG document structure map

I. 2 preface part 1. 2.1 introduction

Technical enthusiasts, after reading this article, you can master the following skills, and you can also learn some other knowledge that you do not know, ~ O (∩ _ ∩) Olympiad:

The judgment of ① full-width characters, or the judgment of strings containing Chinese characters

If there are any mistakes or imperfections in this article, please correct them as much as you can, ITPUB or QQ. Your criticism is the biggest motivation of my writing.

I. 2.2 introduction to the experimental environment

11.2.0.3 RHEL6.5

I. 2.3 introduction to this article

See the netizen asked, how to inquire whether a field data in the table contains full-width characters? This problem involves several functions: to_single_byte, length and lengthb. When I was doing development, I studied how to determine whether a string contains Chinese or not. In fact, it is the same in nature. Let's take a look at the experimental part.

I. 3 Experimental part I. 3.1 lengthb and length functions combined with to_single_byte functions

-contains Chinese characters, strictly speaking, full-width characters

SELECT l.name

Length (l.name)

Lengthb (l.name)

FROM xb_link l

WHERE length (l.name)! = lengthb (l.name)

AND length (l.name)

Tags: Characters functions full-width Chinese characters data strings technology netizens parts experiments fields questions different trading center author preface method power address place Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL Microsoft NVidia Huawei