Sie sind auf Seite 1von 1

Practical no:25 Roll no:- 06 create table Professor(prof_id number(3) primary key,prof_Name varchar2(20),subject varchar2(15 ),qual varchar2(15),salary number(5));

Table created. create or replace trigger prof_trig before insert on professor for each row declare num number:=0; max_prof exception; begin select count(*) into num professor where subject=:new.subject; if(num>9) then dbms_output.put_line(num); raise max_prof; endif; exception when max_prof then raise_application_error(-20001,'no more insertion allowed'); end;

Das könnte Ihnen auch gefallen