Re: Trigger order guaranteed?
Posted in 2011
The serial then will give you the order of insertion. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Thu, Nov 17, 2011 at 8:50 PM, Sean Durity <seandurity@gmail.com> wrote: > There is a timestamp and a serial in the "audit" table. The stored > procedure inserts CURRENT and 0... > > On Thu, Nov 17, 2011 at 5:39 PM, Art Kagel <art.kagel@gmail.com> wrote: > >> Yes, however, you have no way to fetch those rows back in any particular >> order other than the order of the key columns of the table you are >> auditing. SQL does not guarantee the order in which rows are returned >> unless there is an ORDER BY clause. But what would you order on? If you >> have a timestamp on the audit rows, SQL rules require that all timestamps >> within a single transaction always return the time at the beginning of the >> transaction, so all 2000 rows inserted into the audit table will have the >> same timestamp. >> >> Art >> >> Art S. Kagel >> Advanced DataTools (www.advancedatatools.com) >> Blog: http://informix-myview.blogspot.com/ >> >> Disclaimer: Please keep in mind that my own opinions are my own opinions >> and do not reflect on my employer, Advanced DataTools, the IIUG, nor any >> other organization with which I am associated either explicitly, >> implicitly, or by inference. Neither do those opinions reflect those of >> other individuals affiliated with any entity with which I am affiliated nor >> those of the entities themselves. >> >> >> >> On Thu, Nov 17, 2011 at 5:11 PM, The Durster <seandurity@gmail.com>wrote: >> >>> I have a table with insert and delete triggers. The triggers call a >>> stored procedure to insert audit data into another table. Now, I do >>> 2000 inserts and 2000 deletes on the main table within one >>> transaction. Should I expect the rows in the audit table to be >>> inserted in the exact order of the inserts and deletes that fired the >>> triggers? >>> _______________________________________________ >>> Informix-list mailing list >>> Informix-list@iiug.org >>> http://www.iiug.org/mailman/listinfo/informix-list >>> >> >> > > > -- > Sean Durity > Check out my writing for Yahoo!<http://contributor.yahoo.com/user/977624/sean_durity.html> > "We are writing these things so that our joy may be complete." 1 John 1:4 >