Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger error
mcstock wrote:
>really need more info about your process, plus this trigger looks incomplete
>
>basically your no data found is going to refer to SUPTR, where you're
>looking for two records that match values from the record your about to
>insert into MASUPTR
>
>are you sure both records exist? if one does and one doesn't, you'll get the
>NO_DATA_FOUND
>
>if that's the case you'll probably need to do two selects, then check the
>values with PL/SQL expressions
>
>couple suggestions:
>[_] you don't need the REFERENCING clause unless you're changing the NEW and
>OLD references
>[_] you don't need the GROUP BY clause unless your using an aggregate
>function like MAX, SUM, etc (GREATEST is a scalar function)
>[_] always include an exception handler in your code to catch expected
>exceptions, or document that there are none
>[_] consider using explicit cursors for single-row selects -- i believe it's
>still true that they have just a bit less overhead than an implicit cursor
>
>
>
Good advice with one exception. Implicit cursors are always referable to
explicit cursors.
And now, having used the word 'always' I await correction hoping to
learn from it. Perhaps I should
have said 'almost always' but then I wouldn't get the added benefit of
learning from Jonathan, Richard,
Howard, Sybrand, or whoever takes the bait.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Sat Nov 01 2003 - 11:59:59 CST