Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Oracle triggers not always firing

Oracle triggers not always firing

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Fri, 20 Jun 2003 15:50:17 +0100
Message-ID: <E2F6A70FE45242488C865C3BC1245DA703D0D207@lnewton.leeds.lfs.co.uk>


Hi Lisa,

could id be something as simple (!) as a data error which causes an exception to fire. If the exception is handled in the trigger code and not re-raised then the trigger is assumed to have worked ok, but may not have made the changes you expect. The trigger is firing, just not doing what it should because something went wrong and was 'handled' by exception handling in the trigger.

create trigger blah
before update on blah_blah
for each row
...

begin

         do code here which could raise an exception exception

	when stuff 
		process stuff here
		raise
	when other_stuff
		process other stuff here
		raise
	when others then
		null
	end

end

If the exceptions isn't handled explicitly, then the 'others' path is taken, but the exception is not raised again, the system assumes that the trigger worked because the exception was not passed out of the trigger. So, the update goes ahead, but without data from the trigger.

Cheers,
Norman.

--



Norman Dunbar (at home on Linux)
Oracle_at_mssqlBountifulSolutions.co.uk

(Delete a Microsoft database name to reply - clue, mssql !)


-----Original Message-----

From: Lisa McGrath [mailto:lmcgrath_at_uwsa.edu] Posted At: Friday, June 20, 2003 1:48 PM Posted To: server
Conversation: Oracle triggers not always firing Subject: Re: Oracle triggers not always firing

Jim,

thanks for the reply. The transaction is committing. I can check the table the
next day and the updates are there, so the commit must work, but the changes
that should have been made by the trigger are not there.

Lisa Received on Fri Jun 20 2003 - 09:50:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US