Subject Re: [ib-support] Master-Detail constraint checking
Author Martijn Tonies
Perhaps this would be a nice candidate for DEFERRED constraint
checking :)

> >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.


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com

See you at the First European Firebird Conference in May in Fulda, Germany
http://www.firebird-conference.com