Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Row-Trigger question (Oracle 8)
Michael Kreitmann wrote:
> Mark.Powell_at_eds.com (Mark D Powell) wrote in message news:<2687bb95.0411110801.1ba19040_at_posting.google.com>...
>
>>m.kreitmann_at_gmx.net (Michael Kreitmann) wrote in message news:<987ebcdd.0411110035.2ee89cc6_at_posting.google.com>... >> >>>Hello, >>> >>>I've a question about row triggers under oracle. >>>If I define the trigger "FOR EACH ROW", the trigger will be fired n-times >>>if the firing statement will hit n records. Is there any unique ID or hash-code >>>or anything else, that is equal for all of these n executions of this trigger >>>(and only for these n executions ? - the next statement firing the trigger >>>must produce a new (unique) ID ...) >>>Many thanks for your advice! >>> >>>Regards >>>Michael >> >>What is it you are trying to do? >>What version of Oracle will you be using? >>Will the rows you wish to associate be submitted as one transaction or many? >> >>HTH -- Mark D Powell --
Can be done.
How odd it may sound, look up
mutating tables and code to work around that.
Basically, declare an array (PL/SQL table) in a package. Call packaged procedures from your trigger, and fill the array with changed (:old / :new ) values, plus the id, as you go along. Then, in an after-statement trigger, call the packaged procedure that processes the PL/SQL table to fill table 2.
-- Regards, Frank van BortelReceived on Sun Nov 14 2004 - 10:35:28 CST