Auto Increment Doesn't Work

classic Classic list List threaded Threaded
4 messages Options
Tim Schoell Tim Schoell
Reply | Threaded
Open this post in threaded view
|

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.

--
Tim Schoell
We are LIVING like no one else, so that later we can LIVE like no one else.

WE ARE DEBT FREE!!!!!!!


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Noel Noel
Reply | Threaded
Open this post in threaded view
|

Re: Auto Increment Doesn't Work

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
[hidden email]

On 24 January 2016 at 10:53, Tim Schoell <[hidden email]> wrote:

> 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.
>
> --
> Tim Schoell
> We are LIVING like no one else, so that later we can LIVE like no one else.
>
> WE ARE DEBT FREE!!!!!!!
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Auto Increment Doesn't Work

In reply to this post by Tim Schoell
At 17:53 23/01/2016 -0600, Tim Schoell wrote:
>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?

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


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Andreas Säger Andreas Säger
Reply | Threaded
Open this post in threaded view
|

Re: Auto Increment Doesn't Work

In reply to this post by Noel
Am 25.01.2016 um 10:44 schrieb Marion & Noel Lodge:

> 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
> [hidden email]
>

The Base GUI does not change this attribute for an existing field.
Tools>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...


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted