Home » SQL & PL/SQL » SQL & PL/SQL » nChar and nVarchar
nChar and nVarchar [message #189831] Mon, 28 August 2006 00:57 Go to next message
sam4all
Messages: 29
Registered: August 2006
Location: Bangalore
Junior Member
Hi

what is advantage using nChar and nVarchar.In which oracle version it implements?


regards,
Sam
Re: nChar and nVarchar [message #189863 is a reply to message #189831] Mon, 28 August 2006 03:25 Go to previous message
kimant
Messages: 201
Registered: August 2006
Location: Denmark
Senior Member
Hi

From the documentation:

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm

NCHAR and NVARCHAR2 Datatypes
NCHAR and NVARCHAR2 are Unicode datatypes that store Unicode character data. The character set of NCHAR and NVARCHAR2 datatypes can only be either AL16UTF16 or UTF8 and is specified at database creation time as the national character set. AL16UTF16 and UTF8 are both Unicode encoding.

The NCHAR datatype stores fixed-length character strings that correspond to the national character set.

The NVARCHAR2 datatype stores variable length character strings.

When you create a table with an NCHAR or NVARCHAR2 column, the maximum size specified is always in character length semantics. Character length semantics is the default and only length semantics for NCHAR or NVARCHAR2.

For example, if national character set is UTF8, then the following statement defines the maximum byte length of 90 bytes:

CREATE TABLE tab1 (col1 NCHAR(30));

This statement creates a column with maximum character length of 30. The maximum byte length is the multiple of the maximum character length and the maximum number of bytes in each character.

NCHAR
The maximum length of an NCHAR column is 2000 bytes. It can hold up to 2000 characters. The actual data is subject to the maximum byte limit of 2000. The two size constraints must be satisfied simultaneously at run time.

NVARCHAR2
The maximum length of an NVARCHAR2 column is 4000 bytes. It can hold up to 4000 characters. The actual data is subject to the maximum byte limit of 4000. The two size constraints must be satisfied simultaneously at run time.

Br
Kim
Previous Topic: anybody help me i have 2 problem
Next Topic: Tree Level Queries
Goto Forum:
  


Current Time: Sun Dec 04 08:42:07 CST 2016

Total time taken to generate the page: 0.07008 seconds