Key generator

3 posts, 0 answers
  1. Henk
    Henk avatar
    113 posts
    Member since:
    Apr 2006

    Posted 02 Nov 2009 Link to this post

    Hello,

    In our Oracle database the ID field of each table is filled by a unique Oracle sequence for each table.
    Before insert of a new record our client/server application asks for a new ID (select tablename_seq.nextval from dual)
    The value received from the sequence is used during insert of the record.

    Is it possible that OA uses the same mechanism to fill the ID when a new object is created? How can I implement this in my OA model?

  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 04 Nov 2009 Link to this post

    Hello Henk Boen,

     In order to set up things to work with OpenAccess you can create a trigger on insert of a row and set the value of the ID column using the Oracle sequence. You should specify the 'AUTOINC' key generator for the class,using the Forward mapping wizard.

    During runtime, OpenAccess will use the sequence generated ID value to maintain object identity.

    Hope this answers your question.

    Greetings,
    Ady
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Marshmalow
    Marshmalow avatar
    1 posts
    Member since:
    Nov 2006

    Posted 20 Dec 2010 Link to this post

    Hello,
    I have the same problem like in the first post:
    In our Oracle database the ID field of each table is filled by a unique Oracle sequence for each table.
    Before insert of a new record our client/server application asks for a new ID (select tablename_seq.nextval from dual)
    The value received from the sequence is used during insert of the record.

    I cannot use database trigger. I don't know why but my application architect has forbidden me to use trigger in database.
    My question is:
    Is it possible use some different technique for inserting value from sequence to inserting row without trigger ?
    - maybe modify final SQL insert statement, where I would replace inserting value for SEQ_PK.nextval function
    - or is it possible define default value for primary key column where it will SEQ_PK.nextval function like column value ??

    Thanks
    Tomas


     
Back to Top