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


Please Help Members By Posting Answers For Below Questions

when should I use method get, and when should I use method post in my cgis?

603


what is the version of os/400 that we have?

946


how can a message from a message file appear as a constant on the screen?

925


what are the different commands used in rlu ?

1448


how many files can be defined in f specs?

1372






what is a composite key?

998


What is difference between rename and prefix?

578


which type of object is used in db2/400?

643


difference between sflrcdnbr and sflnxtchg?

694


What is RETURN CURSER LOCATION in subfile?

1068


define the rcvf command?

978


Explain this error: "all record formats for externally-described file abcd ignored or dropped due to error; file ignored."?

739


how do you know that records are locked?

1135


what do we can do with the embedded sql statements?

578


To Add A File To The 'file Selection' Option Of A Query, The Function Key To Be Pressed Is?

786