Ever since I’ve been working with databases I have come
across the following pattern of programming. The pattern is an INSERT and LOTS
of UPDATEs. The reason for this pattern is reasonable, and is generally due to
the desired data set being complex to generate from the source database.
For this reason a base set of data
is generated and then updated by a number of updates.
I’ve seen this is two main
scenarios, integration and warehousing. The former is due to a target system
wanting something that the soruce system had in a different structure or a
differnt level and the latter generally wants calculated data like number of
children, or name of last dentist visited.
You might think these should easily
be solved by one query, and if there was only on of these bits of infomation
required that would be easy. However more often than not there are many, and
even worse they are depenent, i.e. given the last dentist someone visted, give
me the number of people that have sued said dentist.
So logically people break this down into manageable chunks.
And do something like .....
...