Student Mark Analysis Database Information System Trigger

Trigger is normally used to perform the fire the operation. If one table is change it is automatically affect another table. It is called trigger.
Source Code PL SQL Programming Student Mark Analysis Database Trigger
SQL> create or replace trigger che_tri before insert on mark list for each row
2 declare
3 m1 number(3);
4 m2 number(3);
5 m3 number(3);
6 m4 number(3);
7 m5 number(3);
8 m6 number(3);
9 begin
10 m1:=:new.mark1;
11 m2:=:new.mark2;
12 m3:=:new.mark3;
13 m4:=:new.mark4;
14 m5:=:new.mark5;
15 m6:=:new.mark6;
16 if m1<0 or m1>100 then
17 raise_application_error(-20011,'error in input');
18 end if;
19 if m2<0 or m2>100 then
20 raise_application_error(-20012,'error in input');
21 end if;
22 if m3<0 or m3>100 then
23 raise_application_error(-20013,'error in input');
24 end if;
25 if m4<0 or m4>100 then
26 raise_application_error(-20014,'error in input');
27 end if;
28 if m5<0 or m5>100 then
29 raise_application_error(-20015,'error in input');
30 end if;
31 if m6<0 or m6>100 then
32 raise_application_error(-20016,'error in input');
33 end if;
34 end;
35 /
Trigger created.
Source Code PL SQL Programming Student Mark Analysis Database Trigger created successfully

Related post