Subject | Re: Help with a trigger/procedure |
---|---|
Author | Adam |
Post date | 2006-09-11T11:59:14Z |
--- In firebird-support@yahoogroups.com, "Fabio Gomes" <fabioxgn@...>
wrote:
MGA will take care of the rest for you. If you follow the procedure,
it is impossible to get inaccurate data.
Transactions starting prior to your sum procedure transaction
committing will see the old values of the table (and so get the right
result). Transactions starting after your sum procedure commits will
not see the deleted records but will see the single record (+ anything
since the sum transaction started).
Adam
wrote:
>for the
> Hi guys,
>
> Sorry for taking this thread out of the grave, but i have another doubt
> about the same thing.
>
> One of the ideas that poped up in this thread was to make a table
> batch numbers and just insert values there, and write a procedure toclean
> up this table once in a while (sum all the rows with the same batchnumber,
> create just one with the total and after that delete all the oldrecords).
>procedure to
> After dirting my hands with code and hitting the head against the wall
> severel times, now i think this would be the best way to do it.
>
> But still i have a doubt.
>
> Lets imagine that my table is filled with data, and i run the
> sum the records of the same batch number and after that create justone row
> with the total qualtity and then delete all the other records.this table
>
> Wich would be the best way to do it? what if more users are using
> when i m running this procedure? how can i prevent my data for beingJust do the sum, delete, insert single row in a single transaction.
> inaccurrate?
>
> Could you guys help me out with this?
MGA will take care of the rest for you. If you follow the procedure,
it is impossible to get inaccurate data.
Transactions starting prior to your sum procedure transaction
committing will see the old values of the table (and so get the right
result). Transactions starting after your sum procedure commits will
not see the deleted records but will see the single record (+ anything
since the sum transaction started).
Adam