Do you notice that during system cutover, we use stored procedures to convert data. When using Oracle substr, we generally encounter the following four problems. 1. Define A variable A as varchar2 (30); 2. assign A value to variable A using substr (xx,) from A table; the content of the xx field is A mixture of Chinese and English;
3. error: the system prompts that the string buffer area is insufficient;
4. Use max (length (xx) to return 20;
I checked it for half a day and confused it for half a day.
I talked with another database developer and found the problem:
1. length, Oracle substr are the number of calculated content, which cannot reflect the number of bytes;
2. If you want to know whether a field can be inserted into a field, use lengthB to calculate the number of bytes;
3. A well-known sentence: a Chinese character contains two bytes;
4. Experience: communicate with others more. Don't be afraid of shame. You must be a teacher for the three!
The above content is an introduction to the problems encountered by Oracle substr. I hope you will have some gains.