Perform actions based on the event, that event is inserting, delete, update operations on tables.
Based on the actions, there are 2 types of triggers.
Here action first, event next.
The event first, action NEXT.
Trigger applied at 2 Levels.
Note - In Tera data V2R5.1 onwards before trigger does not support
Inclined to build a profession as Teradata Developer? Then here is the blog post on, explore Teradata Training
Create trigger< trigger name>()
Replace trigger< trigger name>()
Drop trigger< trigger name>
Help trigger< trigger name>
SHOW trigger< trigger name>
Alter trigger< trigger name>DISABLED
ALTER trigger< trigger name>ENABLED
Create trigger< trigger name> Alter update of (column name)
ON<Table Name>Referencing OLD TALE AS OLD TABLE NEW VABLE AS NEW TABLE.
For each statement/Row
[Where condition]
(Trigger Action)
Create Trigger Vinay after update of (party income) on party for each statement
(Insert into test(11,’Record update’,’00001’););
SHOW Trigger Vinay
Update party set party income=99999 where party id=2
Create table Translog
OLDVALU INTEGER,
NEW VALUE INTEGER,
Record date format’ yyyy-mm-dd’ USE-UPDATED
Varchar (50)Default user
Create trigger Tr log
After update of(party income) on party
Referencing OLD AS O New AS N For Each Row
When(N. Party name>10000)
(Insert into translog (o. party income, N. party income, current-date);)
update party set party income=40000 where party id =2
We cannot use the below statement in the trigger body
Select statement to return as Result
Exception Handling
BEGIN And END Statements
COMMIT
DDL And DCL Statements
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.