Page 1 of 1

ORA-01482: unsupported character set

Posted: Tue 31 Jan 2012 20:16
by ma_devart
For Code-First Development with Entity Framework 4.2, I get this following error while saving data.

ORA-01482: unsupported character set
ORA-06512: at line 4

I guess this is something doing with the datatype. Is there a way to specify specific datatype such as varchar(32) at the entity level.

Thanks,

Posted: Wed 01 Feb 2012 15:00
by Shalex
Please send us a small test project so that we can reproduce the problem in our environment. Also specify the exact (x.xx.xxx) version of your dotConnect for Oracle.

Data Type Specification for Database Generation

Posted: Wed 01 Feb 2012 18:07
by ma_devart
I think the question we are asking is how for database generation do you specify that a string is a CHAR(32) or NVARCHAR(20) or VARCHAR(4) when using Code First?

Can this be done via DataAnnotation attributes or the fluent API? If so how?

We use the current version (6.60.283).

Posted: Mon 06 Feb 2012 18:06
by Shalex
By default, strings in EF Code-First are considered as unicode and without explicit length. That's why they are of NCLOB type. They would be VARCHAR2 if the [not unicode string] and [length < 4000 symbols] settings were specified in fluent (or attribute) mapping for a particular property.

Solution for the attribute mapping. If you indeed have the type in your database which differs from NCLOB, specify this explicitly. E.g.: set the MaxLength(123) attribute if you have the VARCHAR2(123) column in your database. Also turn off PropertyMaxLengthConvention from the Conventions collection in DbModelBuilder (this convention is used for unicode strings).

Solution for the fluent mapping. Set HasMaxLength(123) and IsUnicode(false) for the corresponding property. In this case there is no need to turn off PropertyMaxLengthConvention.