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
what is scan and xlate?
in conjunction with which statements can orxx and andxx conditions be used ?
in which specification the report layout can be defined?
what is the function of crtdupobj command?
what is match field indicator?
can a single screen format occupy a screen area above and below a subfile format ?
what is externally described file ?
Difference Between Call & Sbmjob?
which are the figurative constants used in rpg?
what is arrival sequence?
when do you use f-spec. Continuation line ?
how can a message from a message file appear as a constant on the screen?
give three main purposes of file specification ?
which type of object is used in db2/400?
How do I remove a flag or check no. or name when a user opens too many sessions?