This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11377|Reply: 0

[Source] oracle gets the string length functions length() and hengthb()

[Copy link]
Posted on 3/18/2015 11:17:57 AM | | |

lengthb(string) calculates the length of the byte occupied by the string: returns the length of the string in bytes

length(string) calculates the length of the character occupied by the string: returns the length of the string, in characters


For single-byte characters, LENGTHB and LENGTH are the same.

For example, length('string')=lengthb('string') can be used to determine whether a string contains Chinese.


Notes:

How many bytes a Chinese character occupies in the Oracle database is related to the character set of the database, and in UTF8, the length is three.


select length('cctv') from dual ; You can query how many bytes of Chinese characters are in the Oracle database




Previous:SqlTOOLS (SQL comprehensive utilization tool), there are no resources on the Internet
Next:Oracle system predefined exceptions and user-defined exceptions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com