GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL

 Print  |  
Question:  What is difference between Varchar2 and Nvarchar2?



September 09, 2006 11:23:44 #1
 Sibi John   Member Since: Visitor    Total Comments: N/A 

RE: What is difference between Varchar2 and Nvarchar2?...
 

Varchar2(s) is used to define a variable length character of maximum size s.

Nvarchar2: Same as VARCHAR2 except that the column stores values in the  National CS , ie you can store values in Bangla if your National CS is BN8BSCII .If the National CS is of fixed width CS (all characters are represented by a fixed byte ,say 2 bytes for JA16EUCFIXED) , then NVARCHAR2(30) stores 30 Characters.

If the National CS is of variable width CS (some characters are represented by 1 byte ,some by 2 bytes as in UTF8 ) , then NVARCHAR2(30) stores 30 bytes.
The maximum column size allowed is 4000 bytes.
 Ex: CREATE TABLE tab1 (col1 NVARCHAR2(2000)); will create a table with one NVARCHAR2 column of 2000 characters in length (stored as 4000 bytes, because each character takes two bytes) using JA16EUCFIXED as the national character set:
 
     

 

Back To Question