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

how do you pass parameters in cl?

1035


which cl command is used to trap error messages during program execution?

861


WHICH REPLY CODE IS USED BT sftp ? ... (e.g.226 is used by FTP IF FILE IS TRANSFERED)

1717


Hi,Can any body give the code for the below mentioned quetion.?Im trying to get coding in with easily inderstanding.Plese give me the coding for this? 1.How would you achieve this requirement with out using RPG/RPGLE pgm,but by using only CL?Read a database file and display file contents on the screen when enter key pressed the next record should be displayed on screen.When the last record is reached or when F3 key is pressed the program should exit if the file is empty,a message should be displayed indicate that there are no records to display. Database file Name=EMPDBF Fields in EMPDBF to be displayed on screen Employee Number- EMPNUM(5,0) Employee Name- EMPNAM(30,A) Employee Address-EMP ADDR(50 A)

1732


how will you display a particular page in subfile ?

1046






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

743


is their a difference in cobol400 for the release 5.2 and 6.1 at the as400.

2119


what are different types of substems?

1336


writing an sql statement from selecting records from two files using single statement and nested select statement.

636


what is elastic and non elastic subrile?

563


What is binder language ?

1361


what is the function of cpyf command?

998


when are the unique constraints executed?

673


during input operation which indicator position is seton if there is a record lock?

921


Space & Skip Are Which Level Keywords?

747