A trigger is a stored procedure that executes in response to an event. For example, a trigger can be executed when a row in a table is inserted, updated, or deleted. The trigger tells the DBMS how to process the SQL INSERT, UPDATE, or Delete commands to enforce business rules. You can use the Trigger editor to define the stored procedures that exist for the selected tablein a Teradata physical model.
To define Teradata table triggers
The Table tablename Trigger Editor opens for the table you selected.
A new trigger is added. Work with the following options:
Specifies the name of the trigger.
Specifies the database or user to which the trigger belongs. Select from the drop-down.
Select to execute trigger on insert or update. Make one selection only.
Select to execute trigger on delete.
Specify when trigger is executed: After, Before, For Each Row, For, Instead Of.
Specifies the order to fire the triggers.
Generates DDL for this object during Forward Engineering.
Select to specify that Forward Engineering will use the REPLACE command instead of the CREATE command.
Specifies whether the trigger is enabled or disabled. Select from the drop-down list.
Specifies the scope of the trigger. Select from the drop-down list. Valid values are: Row or Statement.
Indicates the name that you want to use to reference the post-change data in the table. You can use the %RefClause macro to include the REFERENCES clause in the trigger.
Specifies the name for the new row.
Indicates the name that you want to use to reference the pre-change data in the table. You can use the %RefClause macro to include the REFERENCES clause in the trigger.
Specifies the name of the old row.
Specifies the condition on when to trigger.
When you select to execute the trigger on update, this pane becomes active.
Displays the valid columns that can have a trigger fired when updated. Select the appropriate columns.
Displays the relationships and tables associated with the trigger.
The Table Trigger Editor closes.
| Copyright © 2011 CA. All rights reserved. | Email CA Technologies about this topic |