ORA-22859: invalid modification of columns

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
infinity7117
Posts: 2
Joined: Tue 21 Oct 2014 11:19

ORA-22859: invalid modification of columns

Post by infinity7117 » Tue 21 Oct 2014 11:25

Hello,

when using code first migrations,

public class Model
{
public int Id { get; set; }
public string Serial { get; set; }
}

creates a coresponding table with the 'Serial' field as a NCLOB oracle type.

but when adding length restraints to the model like this

public class Model
{
public int Id { get; set; }
[StringLength(50)]
public string Serial { get; set; }
}

and adding a new migration, the type must be converted to a nvarchar type, and Update-Database command fails with
ORA-22859: invalid modification of columns

is there a workaround for this or is manual editing the only option?

Thank you

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: ORA-22859: invalid modification of columns

Post by Shalex » Thu 23 Oct 2014 14:48

Please refer to http://blog.devart.com/entity-framework ... ionSupport: the AlterColumn operation cannot be executed for a LOB column (CLOB/NCLOB/BLOB) in Oracle.

As a workaround, please use DropColumn / AddColumn instead of AlterColumn in this particular case.

Post Reply