MySQL Forums
Forum List  »  Newbie

Re: How should I initialize a header field from the sum of a detail field?
Posted by: Phillip Ward
Date: October 10, 2023 09:18AM

Sounds to me like you Architecture has already dictated your solution, regardless of what the "right way" might be.

For a pair of tables in a single database (which is what most people here are working with), what I suggested - on-demand derivation or triggers - is the "right way" to go.

What you actually have - but didn't mention - is a distributed system with separate tables in separate databases. There's very little that a purely "database" solution can offer you.

You're going to have to handle this at the Application layer with some kind of "reconciliation" process available for those times when it goes wrong (and, let's face it, it will).

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: How should I initialize a header field from the sum of a detail field?
October 10, 2023 09:18AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.