ORA-01482: unsupported character set

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
ma_devart
Posts: 2
Joined: Tue 31 Jan 2012 20:00

ORA-01482: unsupported character set

Post by ma_devart » Tue 31 Jan 2012 20:16

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,

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 01 Feb 2012 15:00

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.

ma_devart
Posts: 2
Joined: Tue 31 Jan 2012 20:00

Data Type Specification for Database Generation

Post by ma_devart » Wed 01 Feb 2012 18:07

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).

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 06 Feb 2012 18:06

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.

Post Reply