Ask Your Question

How to reset the autoincremention in Libreoffice Base [closed]

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

tekkkz gravatar image

updated 2020-07-20 13:04:06 +0200

Alex Kemp 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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-07-20 13:04:15.390311

1 Answer

Sort by » oldest newest most voted

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

Ratslinger gravatar image

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

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

Question Tools

1 follower


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

Seen: 1,884 times

Last updated: Sep 13 '16