Databases Reference
In-Depth Information
A unique index on them would find nothing wrong. But as far as
versions are concerned, these two rows should not both be in the
table. As far as versions are concerned, there is something very
wrong.
Semantically, these are not two pairs of dates. They are the
delimiters of a PERIOD datatype, and in this case, there is a 6-
month overlap of these two time periods. The AVF enforces tem-
poral entity integrity on the basis of an interpretation of these
date pairs as time period delimiters. As far as integrity con-
straints are concerned, the AVF is code which implements, in a
middleware layer located between temporal transactions and
the DBMS, a user-defined PERIOD datatype, and which then
uses that PERIOD datatype in its enforcement of both temporal
entity integrity and temporal referential integrity.
This SQL creates a view that is current whenever it is run.
That is, whenever it is run, it will show all currently asserted
versions about the past, the present and the future. For example,
run any time prior to January 2010, against a table containing
just the three rows used in this example, it would return an
empty result set. Run on January 2010, or on any date after that,
up to but not including April 2010, it would return the result
shown in Figure 6.7 .
And if run on July 2010 or any date after that and prior to any
further changes to the table, it would return the result shown in
Figure 6.8 .
The Assertion Table View
While there are several best practices supporting versions,
there are none that we know of supporting assertions. Future-
dated assertions are something no one other than ourselves
appears to have thought of. Past-dated assertions are just errors
Row #
1
oid
P861
eff-beg
eff-end
Apr10
client
C882
type
HMO
copay
Jan10
$15
Figure 6.7 The Current Version Table View as of April 2010.
Row #
1
oid
P861
eff-beg
eff-end
client
type
copay
$15
$20
$20
Jan10
Apr10
Apr10
C882
HMO
2
3
P861
P861
Jul10
Oct10
C882
C882
HMO
PPO
Jul10
Figure 6.8 The Current Version Table View from July Forwards.
 
Search WWH ::




Custom Search