Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Commit trigger
This triggered a thought. Why not use a trigger to insert a row into a "commit notification table". The row will be visible only upon commit. A separate session can poll the "commit notification table".
Also, how about Advanced Queues? I believe the messages can be made visible only upon commit. The trigger can enqueue a message while the consumer will only see the message after the producer commits.
Tony Aponte
-----Original Message-----
From: Igor Neyman [mailto:ineyman_at_perceptron.com]
Sent: Thursday, October 25, 2001 2:11 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: Commit trigger
Witold,
Writing into a text file, using UTL_FILE, from within table 'insert' (or
'update', or 'delete') trigger is a part of the transaction.
So, if changes are not committed, nothing will be written into a text file.
Should work fine for you.
Igor Neyman, OCP DBA
Perceptron, Inc.
(734)414-4627
ineyman_at_perceptron.com
To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
Sent: Thursday, October 25, 2001 1:50 PM
> Thanks for the reply.
>
> I guess more details may be helpful.
> I need to get data from one table into a text file. The file needs to
> be generated only once after any changes to the table.
>
> It's easy enough to write a program that queries the table and
> generates a file but I thought about automating the process so that
> the user does not need to run any program. I thought about writing
> a PL/SQL using the UTL_FILE package to generate the file (it's a
> small table). But I would want the trigger to fire only when changes
> are commited, not on every insert, update, or delete. And I need
> only the commited data. I guess I was wondering if there was a
> way to write something like COMMIT_CHANGES_TO_A_TABLE
> trigger.
>
> I guess I will end up with small program but if there was a way to
> do it it would be a good learning.
>
> Thanks
>
> Witold
>
>
> On 25 Oct 2001, at 8:30, Amar Kumar Padhi wrote:
>
> > I am sorry, I actually couldn't understand your query?
> > Do you want a gobal trigger for commit and rollback that would fire
> > irrespective of the change involved at table/view level? Afaik, there is
no
> > such trigger.
> > Normally, your table/view level triggers would fire as per the event and
> > apply the change only when commit is done. Same way the changes done via
a
> > trigger would be removed on rollback.
> >
> > Please let the list know what you would actually intend to do if such an
> > option is provided.
> >
> > rgds
> > amar
> >
> >
> >
> > -----Original Message-----
> > Sent: Thursday, October 25, 2001 7:45 PM
> > To: Multiple recipients of list ORACLE-L
> >
> >
> > Hello
> >
> > My life would be easier ;-) if there was a commit (and rollback)
> > trigger - Oracle 8i. I did some research and found various database-
> > level triggers but couldn't find COMMIT and ROLLBACK event
> > triggers. Can one actually write a code that would be fired only at
> > COMMIT and/or ROLLBACK event?
> >
> > Thanks
> >
> > Witold
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Witold Iwaniec
> > INET: wiwaniec_at_novalistech.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Witold Iwaniec
> INET: wiwaniec_at_novalistech.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Igor Neyman INET: ineyman_at_perceptron.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu Oct 25 2001 - 12:35:45 CDT
![]() |
![]() |