Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Trigger syntax
Thu, Aug 12 2010 4:05 AMPermanent Link

Uli Becker

2.03 non-unicode Build 19
Delphi2010

I created a trigger and chose the BeforeInsert event:

Set NewRow.Zeitstempel = CURRENT_DATE;

That works fine.

I created the same trigger and chose the AfterInsert event: I got this
error:

"ElevateDB Error #700 An error was found in the statement at line 4 and
column 7 (Invalid expression "NewRow"."Zeitstempel" found, a value
cannot be assigned to this column reference)"

What am I doing wrong?

BTW: The help file seems to use a wrong syntax (TO instead of =):

CREATE TRIGGER "SetTimeStamp" BEFORE INSERT ON "customer"
AT 1
BEGIN
   SET NEWROW.CreatedOn TO CURRENT_TIMESTAMP();  <-----
END
Thu, Aug 12 2010 3:20 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< I created the same trigger and chose the AfterInsert event: I got this
error: >>

You can't assign a value to a column after an insert or update operation has
already taken place.  You can only do so before the operation.

<< BTW: The help file seems to use a wrong syntax (TO instead of =): >>

Thanks, this is now corrected.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Aug 12 2010 5:02 PMPermanent Link

Uli Becker

Tim,

> You can't assign a value to a column after an insert or update operation
> has already taken place.  You can only do so before the operation.

I see. Thank you!

Uli
Image