one character in Oracle, especially Chinese characters, takes up a few bytes in relation to a character set. For example GBK, Chinese characters will account for two bytes, English one, if it is UTF-8, Chinese characters generally accounted for 3 bytes, English or 1. However, in general, we consider two bytes processing, because the Oracle installation by default we all choose GBK encoding format,
But when we check the length of the input string on the page, the maximum length of the database design field is the maximum length-----prevent the database from being migrated with different encoding format.
View the number of characters the string occupies: Select Length (' 12 Chinese ') from dual; --4 View the number of bytes occupied by the string: Select LENGTHB (' 12 Chinese ') from dual; --8 Nvarchar2 is a kanji character that occupies two bytes, regardless of the character set: Select Length (N ' Zhonghua 1 ') from dual; --3 Select LENGTHB (N ' Zhonghua 1 ') from dual; --6 Supplement: (1) Query Character Set statement: Select Userenv (' language ') from dual; (Simplified Chinese_china. AL32UTF8) query results are divided into three parts: Nls_lang = Language_territory.charset It has three components (language, geography, and character set), Where: language Specifies the language of the server message, territory Specifies the date and number format for the server, CharSet specifies the character set. (2) How to view Oracle's character set, date format, language, etc.? Sys>show parameter NLS; -No specific comprehensive valuesys>select * from Nls_database_parameter; The--nls_database_parameter table is the most detailed.
An issue with the number of bytes occupied by Oracle Kanji