Subject Re: [ib-support] Master-Detail constraint checking
Author Doug Chamberlin
At 4/28/2003 05:30 AM (Monday), Jason Chapman (JAC2) wrote:
>Personally I have in the past used temporary posting tables with an SP to
>post into the main table, the SP can then validate prior to posting in the
>actual nominal ledger. There is only 1 temporary table, it can hold many
>TX's and you tell it which TX you want to post into the ledger. It checks
>and posts or barf's.

Or you could have an additional field which indicates the state of the
journal, either "working" or "complete". A trigger can watch for the
transition of this state from "working" to "complete" and when it is marked
complete, that is when the integrity checks are applied. Only at that point
do the debits and credits have to balance.

You could also have a view of those tables which only returns "complete"
journals so that parts of your application do not have to see the working
journals at all.