Updating a table with ID as autoincrement gives duplicate primary key error

Updating a table with ID as autoincrement gives duplicate primary key error

  
Hi,
I am new to outsystems so need one help in  an issue I am not able to overcome that.
I have an Entity with ID as autoincrement.
Then using oracle SQL developer I added few rows of records in that table.
After that when I am trying to add any new record in that Entity using a bootstrap I am getting duplicate primary key error.
Hi Sanjay,

When you added the rows directly in SQL Developer did you specify the Id's?
Because the auto increments will only work if they are not specified.
You should delete the records that were manually/incorrectly introduced and it should work fine after that.

Regards,
João Rosado

Hi,

Thanks.
But the problem is that we do not have the option to delete the records already present as the project is moved to quite high level. Yes we gave the specific required ids while adding the records directly from SQL Developer.
I need help in making my bootstrap in such a way that it should identify the last Id inserted and start autoincrementing from there.

Regards
Sanjay Saurav

Hi again,

You will need to fix it directly in the database. From Service Studio you would be able to force your bootstrap to use specific ids using Advanced Queries to insert the values ... but that won't fix your Autonumber incrementing. So it would be still a broken table in the future.

Autonumber columns in Oracle are based on triggers and sequences, you will have to manually go do the database, find the sequence associated with the table in question and increment it there.

Regards,
João Rosado