Re: Question on Insert Trigger
Date: Mon, 10 Mar 2008 11:34:54 -0700 (PDT)
On Mar 10, 8:10 am, spamb..._at_milmac.com (Doug Miller) wrote:
> In article <0d2f2afa-9bfc-4400-91a7-0e68f984f..._at_p73g2000hsd.googlegroups.com>, zigzag..._at_yahoo.com wrote:
> >I am using 10.2.0.3 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...").
-- @home.com 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