Page 1 of 1

Looking for TRIGGER Sample

Posted: Mon Feb 13, 2017 5:21 am
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

Re: Looking for TRIGGER Sample

Posted: Thu Mar 23, 2017 8:31 am
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

Re: Looking for TRIGGER Sample

Posted: Thu Mar 23, 2017 1:07 pm
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.

Re: Looking for TRIGGER Sample

Posted: Thu Mar 23, 2017 8:01 pm
by Villeroy
I would be greatful if you, dreamquartz would publish a simple database with triggers.

Re: Looking for TRIGGER Sample

Posted: Thu Mar 23, 2017 8:55 pm
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

Re: Looking for TRIGGER Sample

Posted: Thu Mar 23, 2017 8:57 pm
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