Sequence's LAST_NUMBER value doesn't match the last record ID in a table

Hi Experts,

Does anyone here encountered an issue regarding table sequence. We have this table with 58 records and then when we insert a record to the table from an Outsystems application, we are encountering an error. See below screenshot.


Upon investigation, the sequence does not increments. See below screenshot.

Table max ID:Sequence Details:

Table Details:


Regards,

Froilan

Hello Froilan,

Is this table being "consumed" through integration in the Integration Studio or is it a native OutSystems entity?
If the first, how is the Primary Key being defined in the Integration Studio?

The ID and the number of records don't have to match, but the last ID must match the last number in the sequence. 

There are other applications inserting or updating records in this table? 

Cheers

EDIT: All the applications using this table must use the Sequence approach or you will have this kind of conflict, because (I think), the sequence is not automatically updated if you manually insert records in the table, in Oracle.

Eduardo Jauch wrote:

Hello Froilan,

Is this table being "consumed" through integration in the Integration Studio or is it a native OutSystems entity?
If the first, how is the Primary Key being defined in the Integration Studio?

The ID and the number of records don't have to match, but the last ID must match the last number in the sequence. 

There are other applications inserting or updating records in this table? 

Cheers

EDIT: All the applications using this table must use the Sequence approach or you will have this kind of conflict, because (I think), the sequence is not automatically updated if you manually insert records in the table, in Oracle.

Hi Eduardo, 

It is a native Outsystems entity and no other applications outside of outsystems that are inserting/updating the records in the table. Also we are not manually inserting record directly to the tables since we don't have privileges to do so.

Thanks and regards,

Froi