Error: Change of Identity not supported where column is primary key - Oracle

2 posts, 1 answers
  1. Om Saini
    Om Saini avatar
    1 posts
    Member since:
    Sep 2012

    Posted 16 Nov 2010 Link to this post


    I am using the 2010Q3 release for updating few records in oracle database for one of the applications. Table has a single column which is used as counter and defined as primary key. It doesn't use the sequence in oracle and is manually updated from the last value.

    I am using the following code to update the value in the table but ORM returns me an error "Unsupported operation: Change of Identity not supported"

    private DWModel _entities = new DWModel("DWConnection");
    private long UpdateDocumentCounter()
        var counter = _entities.DOCUMENT_COUNTERs.First();
        counter.CURRENTID = counter.CURRENTID + 1;
        return counter.CURRENTID;

    The designer shows CURRENTID Identity property as true, and Identity mechanism as default. When I try to change it to any other value I get a runtime error ORA-00942: table or view does not exist Telerik.OpenAccess.RT.sql.SQLException

    I can't change the behavior of the other application as its an external vendor app, so have to go with its design. 

    Any help really appreciated.

  2. Answer
    Zoran avatar
    534 posts

    Posted 19 Nov 2010 Link to this post

    Hi Om Saini,

     As you said, the CURRENTID property is identity property for the table where you keep the counter of the id's. However if you would like to update that property, you have to set Identity=false for it as otherwise it can't be modified. You could have another property as identity of this class or just leave it without identity if CURRENTID is the only column in the table thus the only property of the class.

    All the best,
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  3. DevCraft banner
Back to Top