The first part defined how to establish connectivity between the back end and the front end of the project. Next we will see how to implement triggers.
We need to Create the triggers in the oracle.
1) type ed in sql
2) it opens a notepad window
3) type the trigger as in the below example
4) exit the notepad with saving
5)and then type “/”
6) this will show a message as trigger created!
7) It should not show trigger created with compilation errors. If this message is shown check your syntax of trigger.
create or replace trigger votertrig
after update or delete on voter
for each row
insert into votertemp values(:old.id,:old.name,:old.address,:old.age,:old.gender,:old.dob);
Whenever we perform an update or delete operation the old values get stored into the votertemp table and the changed data gets reflected into the permanent table
Visual Basic 6.0
In VB we do not have to do anything as triggers are automatically fired whenever an update or delete operation takes place. The admin can log in into the oracle and view the modifications including the old as well as new values from the voter and votertemp table.
We have successfully set up triggers in the Oracle Back End and when an user deletes or updates any record through the VB front end application the trigger gets fired. We will see procedures in the next part 3.