CA Gen Auto Number creating a record on an Oracle Sequence Table

Document ID : KB000044625
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

There is an existing Oracle database that has a table where the primary key was defined using a sequence.  Records have been added from an external source.

Now, we have the need to create records in that table from our Gen application.  Is CA Gen capable of dealing with the Oracle sequence?  Can we read the next value?   Or, do we need to add a trigger on the Oracle table itself?

We have tested not sending the instance_id (our unique identifier) and it creates a record with an instance id of 0. When trying a second time, we are getting the record already exist error.

 

Instructions:

 

The Toolset will create a derived name when it generates the name of the sequence object in the DDL.  It is not a value that is stored in the model and probably does not match the Oracle database.  As a workaround, you can do an ALTER or RENAME in Oracle to match the sequence object name to the one the Tooolset generates to make this work.