In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
When dealing with problems today, when counting the maximum number of bytes in a field, there was a problem:
select max(len(subject_name)) from dbtabletest;
But the return value is 129.
However, there is always an error on the oracle side, saying that the number of inserted characters is too large, which is really strange.
After a while, I copied the subject_name and found too many spaces behind a line of values in the text editor. Until now, I didn't know that I needed to use datalength to count the spaces at the end. I was really cheated by sql server again.
Fortunately, he finally found the problem!
When using non-Unicode encoding, i.e. varchar type string, DataLength() and Len() are different:
1. Space processing
Len() The number of characters in a string expression, excluding trailing spaces, but counting leading and middle spaces;
DataLength() The number of bytes of any expression, including spaces.
2. Processing of Chinese characters
The difference is that Len only returns the number of characters, and a Chinese character represents a character. Datalength returns the number of bytes, two bytes for a Chinese character.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.