Hi Listmembers,

what I would like to know is the following:
Is it possible to get information about the event that activates the
trigger? What I mean is, if there is a way to get the information the
trigger has been fired because of an UPDATE-Statement und use this
information inside the triggers routine.

Maybe this sound a little bit strange, as of course I can define an
UPDATE-Trigger and an INSERT-Trigger, so it is clear what event-type the
trigger has fired. But when you take a look at the manual, it is possible to
define a trigger that listens on more than one event.

Something like this:
CREATE TRIGGER UIT_TitleContact FOR customers
AFTER UPDATE, INSERT EXECUTE (
Make sure that a new or updated value in column FUNCTION is possible only,
if the new record contains a value for column CONTACTPERSON
)


When you now take notice of the incorrect manual, you know that NEW.<column>
and OLD.<column> are only defined for UPDATE-Triggers, while an
INSERT-Trigger implicit uses a plain <column> inside the routine. Therefore
it seems not possible to combine an UPDATE-Trigger with an INSERT- or
DELETE-Trigger, because inside the routine there is no way to decide if
NEW.<column> (OLD.<column>) or just <column> should be used.

In this situation it would be needful to differ between the releasing
Trigger-Events inside the routine. But I see no way to do this!


Kind regards  & Thanks for help and comments!


BTW: 
I think this issue is a good argument to insert NEW.<column> and
OLD.<column> into Update-/Delete-Trigger-Routines again. It should be
noticed, that this will make more sense too, because inside the
SQL-statements :NEW and :OLD are used, what I find a little bit curious :)
And the third point: After the reimplementation, it is not necessary to
update the manual - then you can discuss it as 'Developement is something
behind the manual' ;)

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to