Before using the number of bytes for Chinese characters in the ORACLE database, I thought that one Chinese Character occupies two bytes. This is true for MSSQL Server (at least within my understanding. If there is an error, please correct it ). But recently I have been using the Oracle database and found some special things, that is, when you use two functions (length and lengthb respectively, what are these two functions used, I don't want to explain it. You can check it for help.) During the query, the result is that lengthb is three times the length (the premise is that the parameters in the length function are all Chinese characters ), this is strange. Isn't Chinese characters occupying two bytes? Why is it three here? So I found the information online. This is actually related to Oracle configuration and can be queried using the following statement:
1 SELECT * from v $ NLS_PARAMETERS t where t. PARAMETER = 'nls _ CHARACTERSET ';
You can query the character set of the current database. If value = ZHS16GBK, a Chinese character occupies 2 bytes. If value = AL32UTF8, a Chinese character occupies 3 bytes. After querying my database, the character set is AL32UTF8 (which is the default Character Set of the Oracle database ).