NVARCHAR2 Data Type
Last updated
Last updated
The
NVARCHAR2
data type specifies a variable-length character string in the national character set. ()
NVARCHAR2 allows to store special characters with their Unicode to be preserved across any usage, these special characters may need more bits to be stored and that is why, by default, the NVARCHAR2 character set is AL16UTF16
, contrary to the common character data set for VARCHAR2 which is usually AL32UTF8
.
NVARCHAR transformed to Snowflake VARCHAR, , is also valid for NVARCHAR2.
Note that the number specified in the column declaration is the size in characters and not in bytes, That is why we see more space used to store those special characters.
Besides these slight differences, the integrity of the data is preserved.
1. Results obtained from some built-in functions may vary
As explained in the previous section, there may be cases using built-in functions over the columns that may retrieve different results. For example, get the length of a column.
: LENGTHB transformed to OCTET_LENGTH.