Ask Your Question
0

LO BASE autovalue vs. FB generator trigger

asked 2020-01-30 17:05:23 +0200

Patrick Demets gravatar image

updated 2020-01-30 17:05:46 +0200

I'm trying to duplicate the LO BASE "autovalue" functionality manually by creating a generator (sequence) and using a Before Insert trigger on a table to populate its ID (integer, not null) column. I was especially wondering if the manual method will result in BASE showing the column as "autovalue", or can that only be achieved by making it that way explicitly only with BASE. Anyone know? Thx

edit retag flag offensive close merge delete

Comments

Hello,

Please when posting a question, provide your OS, the specific LO version you are using and for Base the database you are referring to (and connector type where applicable). Now you may have given this information in past questions but then one must search through those questions for information and it does not mean it is applicable to this question.

Thank you.

Ratslinger gravatar imageRatslinger ( 2020-01-30 18:23:51 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-01-30 18:36:16 +0200

Ratslinger gravatar image

Hello,

This can be answered in different ways depending upon the Firebird database being used - embedded or server.

There are two methods for creating an auto increment primary key field. For both methods see this post -> How to create an auto-increment ID column in a Firebird embedded database table? Errors encountered..

If using the Trigger method, the AutoValue area in a table edit is not seen. Also the value is not seen in a form or table view until it is refreshed. This occurs in both server and embedded.

If using the identity method, for server it is the same as when using a Trigger. However, with embedded the AutoValue in a table edit is seen and the value is immediately shown in a form or table view.

edit flag offensive delete link more

Comments

As with all questions, if this answers your question please tick the ✔ (upper left area of answer). It helps others to know there was an accepted answer.

Ratslinger gravatar imageRatslinger ( 2020-01-30 18:38:41 +0200 )edit

I'm working with an embedded Firebird 3 database. I've verified that the trigger method works (yes, I noticed that records did not show up correctly [I also have two audit timestamp columns populated via triggers] until I exit and re-open the table view). Will try the Identity method, which seems much simpler and has the advantage of showing as Autovalue in LO BASE. Thanks!

Patrick Demets gravatar imagePatrick Demets ( 2020-01-31 21:55:33 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-01-30 17:05:23 +0200

Seen: 69 times

Last updated: Jan 30 '20