Please send questions to st10@humboldt.edu .

-- last modified: 12-1-10

---------------------------------------------------------------------------
-- TRIGGER EXAMPLE #2
---------------------------------------------------------------------------
-- this trigger was added to add rows to the
-- advisee_ct table as professors are added
-- (yes, this WAS allowed --- evidently you can have one
-- "before actions" trigger, and one "after actions" trigger,
-- per table?!)
--
-- also available as trigger2.sql and add_prof_ct.sql
---------------------------------------------------------------------------

create or replace trigger add_prof_ct
after insert
on prof
for each row

begin
	-- a new prof has no advisees yet

	insert into advisee_ct
	values
	(:new.prof_id, 0);
end;
/
show errors