[Tfug] "Ordering" tuples in a table
Bexley Hall
bexley401 at yahoo.com
Mon Oct 19 23:35:00 MST 2009
Hi Zack,
> > So, how do you do this? Consider a record for a
> > "person" having fields that specify name, birthdate, etc.
> > In addition, fields that REFERENCE *other* records
> > defining the "mother" and "father" for that "person".
> > I.e., how do you refer to a mother who's record doesn't
> > yet exist??
>
> Special value in the field, such as blank or -1.
> Special case for this in code.
No, sorry, I guess I wasn't clear enough.
You're entering the record for "Bart Simpson".
His Mom is "Marge Simpson" -- you *know* that.
But, what you really want to record for Bart is a
"reference" to the PEOPLE record for his mom, Marge.
But, you haven't yet entered Marge's name into the database
(perhaps it is he very *next* name that you intend to enter!).
As such, you don't have a way to refer to that record, yet...
You are either forced to run a second pass through the
data (theoretically, you could have to run as many
passes through the data as there are records in your databse!)
to "fixup" these data
or
are forced to enter the records in a particular order
(which adds another dimension to the data that is not
present in the RDBMS's data model!)
More information about the tfug
mailing list