Auto Increment Doesn't Work

I am new to databases, but I wanted to set one up to keep track of the cars I work on at home. The problem I have is that when I go to create a new table, whether I use the Wizard or Design View to create the table, I can't get the primary key to automatically increment.

I have the 1st field as CustomerID. I set it as Integer, and the click on the AutoValue to Yes. I add the other fields, such as name, address, phone number, etc, save the table.

When I go to add data, it always wants me to input a value for CustomerID. What am I doing wrong?

Thanks for your help.

Hi Tim,

It may depend on which Database you are using with LibreOffice.

I use the H2 Database and in my tables if I make CustomerID's type
BigInt[Identity],
then AutoValue = 'Yes works. That might be worth trying in your situation.

Noel

Probably nothing: this appears to be a bug. See
https://bugs.documentfoundation.org/show_bug.cgi?id=42905 .

When you add data, the AutoValue field should show "<AutoField>"; if it is blank, then the process of creating the table has failed. The workaround is simple:
o Close the table.
o Select the table in the Tables panel.
o Go to Edit | Edit... (or right-click | Edit).
o Select the appropriate field.
o In the Field Properties panel at the bottom, change AutoValue from No to Yes.
o Close and save changes.

I trust this helps.

Brian Barker

Hi Tim,

It may depend on which Database you are using with LibreOffice.

I use the H2 Database and in my tables if I make CustomerID's type
BigInt[Identity],
then AutoValue = 'Yes works. That might be worth trying in your situation.

Noel
--
Noel Lodge
lodgemn@gmail.com

The Base GUI does not change this attribute for an existing field.

SQL...

ALTER TABLE "table name" ALTER COLUMN "CustomerID" INTEGER GENERATED BY
DEFAULT AS IDENTITY;
[replace "table name" with the actual name of your table in double-quotes]

menu:View>RefreshTables...