All Forums Database
Elle 16 posts Joined 11/07
13 Dec 2011
After Insert trigger

Hello,

 

I am trying to create the following trigger, which is almost identical to a sample one that Teradata offers in their documentation.  However, I receive the error " CREATE TRIGGER Failed. 5424:  A triggered action statement is the wrong kind. "  Can anyone tell me what is wrong with the trigger?

 

 

CREATE TRIGGER workdb.lw_gg_latency_ins

AFTER INSERT ON workdb.lw_gg_latency_tbl

REFERENCING NEW AS NewRow

FOR EACH ROW

(

set NewRow.latency_sec = cast(extract(day from ((NewRow.trg_ins_time - NewRow.src_ins_time) day(3) to second)) +

extract(hour from ((NewRow.trg_ins_time - NewRow.src_ins_time) day(3) to second)) * 24 +

extract(minute from ((NewRow.trg_ins_time - NewRow.src_ins_time) day(3) to second)) * 60 +

extract(second from ((NewRow.trg_ins_time - NewRow.src_ins_time) day(3) to second)) as int)

;

)

 

Thank you for your assistance.

 

Linda

crochlit 1 post Joined 11/14
20 Jun 2016

The issue is well explained on this page:
http://teradataerror.com/5424-A-triggered-action-statement-is-the-wrong-kind.html
"SET" can only be used in a BEFORE row triggers

Carl Rochlitz

dnoeth 4628 posts Joined 11/04
20 Jun 2016

Well, this is a website which simply copies the error descriptions from Teradata's Messages manual.
http://www.info.teradata.com/HTMLPubs/DB_TTU_15_10/index.html#page/General_Reference/B035_1096_151K/4-Database.28.1758.html#ww1883876

Dieter

You must sign in to leave a comment.