• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

sequence Table (0)

Some tooltip text!
• 2 minutes to read
 • 2 minutes to read

next_id to be used for each table

Fields

Name Description Type Null
id Sequence-id of host table PK
next_id Next id to be used for table Id ●
TableName The name of the table this row concerns String(255) ●
TableNumber The table number for this table, constant over the table's lifetime (but possibly different from one database to another Int ●

sequence table relationship diagram

Use of the Sequence table

The sequence table contains the next unallocated ID for each SuperOffice table.

Each sequential row has its own ID number, which is 10 + the table number in the table listing.

When inserting a new row in a table you will need to allocate the ID value to use for this record.

Reading and updating the next ID value should always be performed as a single transaction because if someone else reads and updates this information simultaneously, a database error will occur when inserting the new row.

Example:

Allocate an ID for Contact table

(Contact is table 5, + 10 = 15)

BEGIN TRANSACTION
UPDATE Sequence SET next_id = next_id + 1 WHERE id = 15;
SELECT next_id - 1 FROM Sequence WHERE id = 15;
COMMIT TRANSACTION

Indexes

Fields Types Description
id PK Clustered, Unique
TableName String(255) Unique
TableNumber Int Unique

Replication Flags

  • None

Security Flags

  • No access control via user's Role.
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top