Best source for documentation sought

I think Libre Office will be a great resource. I would like to be able to use it extensively, but I’m not connecting the dots on how to learn it.

For instance, the table wizard in Base prompts for an “Auto-increment statement”. Googling for things like “libre base auto-increment statement” doesn’t seem to find anything.

Searching the Base documentation doesn’t locate that phrase.

Anything I put in there causes an error, and I generally experience a crash within minutes of trying to explore Base.

I know it represents a lot of hard work by developers. Is there a good source of documentation for someone who knows what an auto-increment field is, but can’t crack the code on what to enter in that at least somewhat undocumented field?

Please don’t hate me. I want to learn.

My dear friend,

After having read your concern to the world of computing machines, i do think this approach may not be the one for you, but believe me, later on you’ll find out how come a simple user can choose automatic numbering instead of manual…

Did you google that in English or another language? I just tried and it came up with a bunch of options. You’ll get even better options if you google “libreoffice database auto increment statement”.

But I suspect you might need to learn the basics of database design.

You could start here: https://books.libreoffice.org

@Amontillado : You won’t need this for an internal database. It will work automatically. Auto increment entries are only needed for connecting through JDBC to an external database. For MySQL/MariaDB it is implemented by the wizard automatically. Same for PostgreSQL. So it depends on the database you want to connect to.

1 Like

Creating a database with an autoincrementing unique key in mysql or postgres is not a big deal. I wanted to know what the “auto-increment statement” field was for in the table wizard. Was it to specify the step? To turn on auto-increment, which seemed to be a decision already made?

I found this resource - https://documentation.libreoffice.org/assets/Uploads/Documentation/en/BG7.2/BG72-BaseGuide.pdf. The text string “auto-increment” does not appear in that document, which probably addresses older versions.

Thank you for help, though. I appreciate it.

@Amontillado : You could only choose entries for this statement, if the driver doesn’t set the statements by default. If using MySQL/MariaDB and following the wizard for MySQL/MariaDB databases there won’t be any possibility to add this entry in Edit → Database → Advanced Settings. If you try to connect to MySQL/MariaDB by ignoring the wizard and start with choosing JDBC instead you would find Edit → Database → Advanced Settings → Generated Values. Here you could add ‘AUTO_INCREMENT’ for Auto-increment statement and mark Retrieve generated values.
If you are using PostgreSQL you couldn’t choose any entry for Generated Values. GUI seems to offer automatic values, but it won’t work well. You have to set the AutoValue by SQL with a code like

CREATE TABLE "public"."Test" (
"ID" SERIAL PRIMARY KEY
);

through Tools → SQL. For JDBC connection you could choose the field type “Serial” in the table editor and no entry should be set to Generated Values.
SQLite works only with JDBC here. Generate values are the same like rowid here. You have only to set a field to primary key, which has field type Integer. It will be automatically filled by values, but this automatic values will only be shown in GUI after reloading the table. You could also set generated value through SQL directly:

CREATE TABLE "tbl_Personen" (
"ID" INTEGER PRIMARY KEY AUTOINCREMENT,
"Name" TEXT NOT NULL
);

This will increment automatically and will be shown in GUI. But it won’t work with Generated Values, because the additional AUTOINCREMENT is needed after defining PRIMARY KEY. Such a code won’t be created by the table wizard.

@RobertG - Very nice explanation. Thank you!

:thinking:
LibreOffice 24.2 Help - Generated Values

1 Like

Thanks, fpy - that’s the first instance I’ve seen documenting what is expected in that field. I’ve bookmarked that link and look forward to learning details of Libre Office. The combination of a word processor with a database is intriguing.

Hi,

Sorry for intrusion, I DO NOT WANT TO BOTHER! But, as long as I remember, i’ts been more than forty years that programs allow either manual or automatic numbering. Frankly I do NOT understand THE REASON FOR ARGUING ABOUT THAT.

Bye

feel free to bring your input too :wink:
Joining the Documentation Team - The Document Foundation Wiki

My misunderstanding was about the field, not the function. Yes, auto-inc is a simple concept supported by every database system I’ve ever used, although my memories of dBase II on an Apple II CP/M card are a little dim.

The answer I found to the question I tried to ask is this. The auto-increment statement is appropriate syntax for the target database, e.g., “auto_increment”. I assume “auto_increment = 100” would be fine for a MySQL backend.

There are no LibreBase restrictions on what goes there. It is something passed to create table in whatever database the user wants to use.

It’s easy for a conversation in text to sound like an argument and I must have failed when I said that I knew it would be a great resource, and that it represents a lot of hard work by developers.

I shall - but only after my knowledge of Libre Office is much deeper.

Edited - and thank you for your kind invitation.

Do you want to set the “start point” for auto-incremented values?
It will also depend on the system you are using.
HSQLDB: ALTER TABLE "Tablename" ALTER "ID" RESTART WITH 100; Next choosen value will be 100.
Firebird needs the last choosen value, so RESTART WITH 99 gives 100 for next value.

1 Like