Guddu
Guddu

Reputation: 1588

Django Oracle Database - Varchar2 Vs NVarchar2

I have the following character field in my model (against Oracle Database).

trans_status = models.CharField(max_length=10, blank=True, null=True)

Why does Django create this field as NVARCHAR2 instead of VARCHAR2? I mean,

Why

trans_status           NVARCHAR2(10)  NULL,

instead of

trans_status           VARCHAR2(10)  NULL,

What is the difference? How does Django decide on one and not the other?

Upvotes: 1

Views: 1060

Answers (1)

Emad Mokhtar
Emad Mokhtar

Reputation: 3297

NVARCHAR2 will store the data with 16-bit characters, and VARCHAR2 will store the data with 8-bit characters. The difference that NVARCHAR2 will store unicode characters like Arabic characters, but it'll consume double size more than VARCHAR2.

Upvotes: 3

Related Questions