AFTER DELETE Trigger

General
New Member

AFTER DELETE Trigger

I have a after delete trigger with for each statement level as below , I am trying to call a stored procedure by passing a column from old_table ,but I am getting the error as " REPLACE TRIGGER Failed.  [5396] An OLD_TABLE or NEW_TABLE alias was referenced without using a subquery."

Trigger definition :

REPLACE TRIGGER ABC.EMPLOYEE_DELETE
AFTER DELETE ON ABC.EMPLOYEE
REFERENCING OLD_TABLE AS OLDTAB
FOR EACH STATEMENT
(
CALL XYZ.LOG_TABLE_CALL (SESSION, OLDTAB.EMP_NAME,USER) ;
);

1 REPLY
Highlighted
Teradata Employee

Re: AFTER DELETE Trigger

Since this is a STATEMENT trigger, it must be coded to operate on a set of rows rather than one row at a time.

 

Think of OLD TABLE as an alias for a volatile table that potentially has multiple rows. The alias can be used in a FROM clause, but can't be passed into a Stored Procedure.