1752762 Members
4897 Online
108789 Solutions
New Discussion юеВ

Re: trigger on entry

 
SOLVED
Go to solution
Ratzie
Super Advisor

trigger on entry

I know I should probably source elsewhere but the help that I receive from this site is the best.
Oracle 10.2.0.2
Is there a way to write a trigger, ( new to this ) that upon entry in the table that if column2 has entry of 5032, send an alert, via email or such, I do not know if this is possible...
4 REPLIES 4
Steven E. Protter
Exalted Contributor
Solution

Re: trigger on entry

Shalom,

Outside my comfort zone but here is some documentation:

http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_7004.htm

http://www.psoug.org/reference/table_trigger.html

http://www.adp-gmbh.ch/ora/sql/create_trigger.html

http://members.tripod.com/mdameryk/CreateOrclTrgr.htm

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Eric Antunes
Honored Contributor

Re: trigger on entry

Hi,

There is an issue with triggers on the database and third party stuffs: the Oracle database can rollback changes but cannot rollback an e-mail already sent.

Your trigger should be like:

CREATE OR REPLACE TRIGGER .
after insert on .
for each row
DECLARE
...
BEGIN
if :new.column2 = '5032' then
send e-mail (I don't know any package utility to do that...)
end if;
END;


Eric Antunes
Each and every day is a good day to learn.
SSCHAER
Advisor

Re: trigger on entry

inside the trigger simply execute the dbms_mail package and use the send function.
Ratzie
Super Advisor

Re: trigger on entry

Muchly appreciated, will try