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

what is scan and xlate?

1086


in conjunction with which statements can orxx and andxx conditions be used ?

1133


in which specification the report layout can be defined?

976


what is the function of crtdupobj command?

1150


what is match field indicator?

1017






can a single screen format occupy a screen area above and below a subfile format ?

1023


what is externally described file ?

935


Difference Between Call & Sbmjob?

772


which are the figurative constants used in rpg?

841


what is arrival sequence?

1109


when do you use f-spec. Continuation line ?

973


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

931


give three main purposes of file specification ?

990


which type of object is used in db2/400?

645


How do I remove a flag or check no. or name when a user opens too many sessions?

1773