﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25962	inspectdb for oracle nvarchar2 could miscalculate field size 2-fold	JorisBenschop	nobody	"Hi, I've noticed a consistent discrepancy between Oracle tables and django inspectdb results when it comes to NVARCHAR2 data types. Let's say I add this column to my table:
{{{
alter table STUDY add (TREATMENT NVARCHAR2(500));
}}}
If I then run manage.py inspectdb, I see the following result:
{{{
 treatment = models.CharField(max_length=1000, blank=True, null=True)
}}}
From the oracle docs:
{{{
The NVARCHAR2 datatype is a Unicode-only datatype. When you create a table with an NVARCHAR2 column, you supply the maximum number of characters it can hold.
}}}

Now most likely I'm making a calculation mistakes, but to me this seems that the column allows for a 500 character input, whereas Django will allow a 1000 character input instead. If this is indeed the case, I guess this is the result from the 16bit input format that NVARCHAR2 has compared to 8-bit VARCHAR2.

My apologies if this is documented, already reported or just stupidity
"	Bug	closed	Database layer (models, ORM)	1.9	Normal	duplicate	Oracle		Unreviewed	0	0	0	0	0	0
