Looking for TRIGGER Sample

Discuss the database features
Post Reply
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Looking for TRIGGER Sample

Post by dreamquartz »

Hi All,

I looking for examples of working TRIGGERS, and specifically for situations where a VIEW is included.
I cannot seem to find anything in literature.

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Looking for TRIGGER Sample

Post by dreamquartz »

dreamquartz wrote:Hi All,

I looking for examples of working TRIGGERS, and specifically for situations where a VIEW is included.
I cannot seem to find anything in literature.

Dream
Even with one of the nastiest problems solved (see viewtopic.php?f=13&t=86906) I am still looking for examples to help to create different types of TRIGGERS, and especially to be used with VIEWS.
Does anyone know where to find good examples, and/or reference material?

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
eremmel
Posts: 1080
Joined: Tue Dec 30, 2008 1:15 am

Re: Looking for TRIGGER Sample

Post by eremmel »

I assume particular for HSQLDB 2.x...
As I told you before, you can put (almost) any SQL in a trigger. So when you are able to write a SQL update/insert script with as input the three involved table rows you are almost done.
Also build up your problem is small steps / experiments.
It just comes down to read the documentation carefully. I did that for your insert trigger as well, just curious how to do that with HSQLDB.
It's Microsoft marketing that tells you computers are qualified for non-technicians
W11 22H2 (build 22621), LO 7.4.2.3(x64)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Looking for TRIGGER Sample

Post by Villeroy »

I would be greatful if you, dreamquartz would publish a simple database with triggers.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Looking for TRIGGER Sample

Post by dreamquartz »

eremmel wrote:I assume particular for HSQLDB 2.x...
As I told you before, you can put (almost) any SQL in a trigger. So when you are able to write a SQL update/insert script with as input the three involved table rows you are almost done.
Also build up your problem is small steps / experiments.
It just comes down to read the documentation carefully. I did that for your insert trigger as well, just curious how to do that with HSQLDB.
I am trying to work on examples that could be useful to the community.
That was my plan from the getgo.
I probably did read upon everything I could find concerning TRIGGERS, and even communicated with http://www.hsqldb.org about them.

However other work is keeping me very busy, and this has to sneak in between.
It turns out to be quite a tedious process, and yes by the infamous programming coding method called "Trial and Error", we are building up some better understanding of what can be accomplished.

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Looking for TRIGGER Sample

Post by dreamquartz »

Villeroy wrote:I would be greatful if you, dreamquartz would publish a simple database with triggers.
See also my response to eremmel.

From the beginning it was my goal to provide the community with examples.
It surprised us that there was/is practically nothing available.

I will get examples out there so that everyone can benefit.

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
Post Reply