Tuesday, June 14, 2022

Oracle SQL NCHAR and NVARCHAR2 Data Types

NCHAR

 

1.It is useful to store UNICODE character values with fixed length.
2.Max. size is 2000 chars/bytes.
3.The number of bytes can be up to two times size for AL16UTF16 encoding and three times size for UTF8 encoding.
4.Maximum size is determined by the national character set definition, with an upper limit of 2000 bytes.
5.Default and minimum size is 1 character.
 

 NVARCHAR2

 

1.To store variable length UNICODE character values.
2.Max size is 4000 bytes or chars.
3.You must specify size for NVARCHAR2.
4.The number of bytes can be up to two times size for AL16UTF16 encoding and three times size for UTF8 encoding.
5.Maximum size is determined by the national character set definition, with an upper limit of:
32767 bytes if MAX_STRING_SIZE = EXTENDED
4000 bytes if MAX_STRING_SIZE = STANDARD

No comments:

Post a Comment