Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread How to realize this?
Sun, Aug 15 2010 4:37 AMPermanent Link

Uli Becker

I want to compute the quarter of a date and automatically enter this
value in a field. I wrote a function and tried this trigger, assuming
that "BeforeUpdate" triggers also with new records:

CREATE TRIGGER "EnterQuartal" BEFORE UPDATE  ON "Leistungen"
BEGIN
  SET NEWROW.Quartal = GetQuartalFromDate(NEWROW.Datum);
END

How can I do the same with a *NEW* record? IOW: the user enters a new
record with a date and the corresponding quarter should be entered
automatically.

Thanks Uli
Sun, Aug 15 2010 5:54 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli


What about a BEFORE INSERT trigger or the new ALL type. Haven't used it yet myself but its on my list to convert my existing triggers to this.

ALL isn't well documented yet but there is a post about it somewhere in the ng. Sorry but I don't know where

Roy Lambert [Team Elevate]
Sun, Aug 15 2010 8:25 AMPermanent Link

Uli Becker

Roy Lambert,

> What about a BEFORE INSERT trigger

Thanks for pointing to the right way. I made the old mistake and had in
minde that "Before Insert" is fired *BEFORE* the empty record is
inserted. Actually it means the same as "OnBeforePost".

Works fine now.

Regards Uli
Image