Re: Question on Insert Trigger

From: joel garry <>
Date: Mon, 10 Mar 2008 11:34:54 -0700 (PDT)
Message-ID: <>

On Mar 10, 8:10 am, (Doug Miller) wrote:
> In article <>, wrote:
> >I am using on HP UNIX 11i.
> >I have a third party application where I do not have access to code.
> >When rows are inserted in a table, I do not want certain  rows to be
> >inserted . Rest of the rows should be inserted. Is it is possible to
> >do this using  a trigger.
> >I wrote a trigger like following. This trigger is for illustrative
> >purposes; conditions for filtering are more complex.
> >create or replace trigger emp_aftins
> >after INSERT ON employee
> Perhaps I'm missing something that should be obvious... but why would you want
> to trigger *after* the insert? Don't you really want to trigger *before*
> insert, and insert only data that satisfies your criteria?

Maybe he wants to do something like create rows for the end-of- probation tasks only after the employee is properly inserted, which may be considered a separate transaction business-wise - some other user may have to enter additional information, which was part of the original app transaction that he cannot change.

It's not uncommon for off-the-shelf applications to need strange mods for customization that would otherwise be straightforward. I've worked on a couple in the last week where people want the same report run for many inputs, and the reports are written for a single input (ie, division). I could either modify lots and lots of code, or I can hack a report-driver in an hour. If I worked for the app vendor, or it was some code that would be reused elsewhere, obviously I'd do the former. We can't judge odd requirements (though there's nothing wrong with "oh man, I've seen that mistake before...").


-- is bogus.
Really, really unclear on the concept:  Espiscopalians in Massachusets
burning candles instead of using electric lights in religious
contexts, in order to reduce carbon footprint...
Received on Mon Mar 10 2008 - 13:34:54 CDT

Original text of this message