What are Triggers?
Answer Posted / sujanindian
Triggers is a self contained set of transact executable
statements which can be invoked during the operations such as
insert,update,delete can be performed in a database file.
We can able to add trigger in a physical file :
ADDPFTRG
to remove a trigger : RMVPFTRG
In the case of SQL/400 we can create trigger by ....
>>STRSQL
>>CREATE TRIGGER TRG_Name
after INSERT/DELETE/UPDATE On PF1
Insert Into PF2 Values ('RECORDS DELETED IN PF1')
>>Delete FROM PF1 Where Recordno = 10
>>SElect * FROM PF2.
In the above code, the records in the PF1 is deleted , at
once the trigger trg_name is fired and the given insert
statement is activated in pf2.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
when should I use method get, and when should I use method post in my cgis?
what is the version of os/400 that we have?
how can a message from a message file appear as a constant on the screen?
what are the different commands used in rlu ?
how many files can be defined in f specs?
what is a composite key?
What is difference between rename and prefix?
which type of object is used in db2/400?
difference between sflrcdnbr and sflnxtchg?
What is RETURN CURSER LOCATION in subfile?
define the rcvf command?
Explain this error: "all record formats for externally-described file abcd ignored or dropped due to error; file ignored."?
how do you know that records are locked?
what do we can do with the embedded sql statements?
To Add A File To The 'file Selection' Option Of A Query, The Function Key To Be Pressed Is?