Ask Your Question

Setting Prefixes to Field Types

asked 2017-10-19 06:24:27 +0200

Clinton gravatar image

I'm trying to build a database and wish to set Alphanumeric prefixes in front of an auto generated sequential number. Is this possible in LibreOffice base?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-10-19 08:01:43 +0200

Ratslinger gravatar image


The answer to your question is Yes..... and NO.

You can only set an INTEGER or BIGINT (default HSQLDB) to an AutoValue which automatically becomes a part of the Primary KEY. This cannot be modified. You can also set another field (your prefix) to be another part of the primary key. Therefore, the primary key would actually consist of two fields. However, the AutoValue will increment with every record added and not for each prefix you have. Probably not what you are looking for.

The other way would be to create the key via a macro, but macro experience is necessary. You would need to have a routine to look up the last value created and increment that to be used as the key. Could get a bit messy.

If this answers your question please click on the ✔ (upper left area of answer).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-10-19 06:24:27 +0200

Seen: 77 times

Last updated: Oct 19 '17