SQLSERVER and Oracle Substring Problem

xiaoxiao2021-03-05  21

Touching a subString problem today is caused by double bytes.

SQLServer's substring (str, start, length) and Oracle's substr (STR, START, LENGTH) feature are almost identical. It is important to pay attention to the length of the string according to the current character set.

If Str = 'IAM Chinese', SubString (STR, 3, 2) returns "M in" M in the Chinese database, but the two bytes starting from m under the English database.

So if you want to take data according to bytes, you have to figure out otherwise.

Oracle is simple, you can use SubStrb

SQLServer does not have a corresponding function, you can only turn the STR to a Varbinary type, then use Substring.

转载请注明原文地址:https://www.9cbs.com/read-39121.html

New Post(0)