Ask Your Question

How to reset the autoincremention in Libreoffice Base

asked 2016-09-13 18:13:26 +0100

tekkkz gravatar image

I have a table in libreoffice base, with a column named id. This column is set as auto-increment

for some reason the counting failed there:


How to get back to the correct counting, before_value + 1 ... ? e.g. reset the counter? how?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-09-13 18:42:18 +0100

Ratslinger gravatar image

updated 2016-09-13 18:55:38 +0100

Run this from main screen menu Tools->SQL...

alter table "your_table_name" alter column "your_field_name"  restart with XXX

Where XXX = number to restart with.

Not sure what you mean by "counting failed". The actual value of the field shouldn't matter when auto incrementing. You will end up with gaps when deleting records. Those numbers are not re-used.

Edit: NOTE this will NOT re-sequence the counter.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-09-13 18:13:26 +0100

Seen: 1,374 times

Last updated: Sep 13 '16