Associate Entities to Sequences

Sequences are database objects that the sequence generator in the database uses to generate sequential values. The database can auto-generate unique primary keys using these sequential values. Without the presence of identity columns, the database can obtain a new primary key value using these sequences.
calac41
Sequences
 are database objects that the sequence generator in the database uses to generate sequential values. The database can auto-generate unique primary keys using these sequential values. Without the presence of identity columns, the database can obtain a new primary key value using these sequences.
When you connect to a database that supports sequences, such as Oracle, 
CA Live API Creator
 detects the sequences that are defined in your schema.
CA Live API Creator
 cannot know which entity (table or view) uses which sequence.
Associate entity columns to sequences if 
all
 of the following cases are true:
  • Your database includes sequences.
  • You want the database to generate unique primary keys during row inserts.
  • You want 
    CA Live API Creator
     to auto-generate numbers for the entity columns using the sequences.
  • You want 
    CA Live API Creator
     to set the primary key for the entities.
For more information:
  • About the databases that support sequences, see the documentation for the specific data source.
  • About how to insert rows, see INSERT Metadata Action Tag.
The Oracle Sequence Example API sample illustrates an example of how you can have
CA Live API Creator
:
  • Insert a parent and a set of children in the same request.
  • Compute an alphanumeric primary key in an early event rule using sequences.
For more information about this API sample, see Oracle Sequence Example API Sample.
Follow these steps:
  1. With your API open, In the Create section, click 
    Data Sources
    .
    The Connection tab appears by default.
  2. Click the 
    Sequences
     tab.
    The Sequences page displays. The entities, the available columns, and the sequence names that 
    CA Live API Creator
     detects for the data source are displayed. 
  3. For each entity that uses a sequence, select the entity column and the sequence for the entity, and then save your changes. To have the Oracle database generate sequential values for the entity's columns, select the entity column, and then accept the default value (
    <None>
    ) for 
    Sequence
    .
The entity is associated to the sequence.