note
herveus
Howdy!
<P>
We are making some progress here.
<P>
However, I have some concerns.
<P>
You say:<BR>
<CODE>sector(s_id, d_id, name);
department(d_id, dd_id, name);
division(dd_id, ... , name);</CODE>
<P>
That looks a bit backwards from a normalization point of
view. It appears that the higher level entity contains
a pointer to the lower level entity, which is exactly
backward from how it ought to be.
<P>
Consider:<BR>
<CODE>sector(s_id, name, ...)
department(d_id, s_id, name, ...)
division(dd_id, d_id, name, ...)</CODE>
<P>
In this rough schema, a department has a sector ID. In your
schema, either a sector has to have multiple columns for
department IDs or there have to be duplicate sector entries
if a sector has more than one department.
<P>
Now, to get back to your actual question, if your
requirement is simply to be able to use DBI, then without
prior knowledge of the set of tables, you cannot depend
on being able to discover the relationships, since not
all DBDs offer that kind of support (DBD::CSV, DBD::RAM,
for instance).
<P>
If you must use DBI with any arbitrary DBD for the data
store, you will have to know up front the set of tables
to examine. You won't even be able to count on getting a
list of tables in the "database".
<P>
yours,<BR>
Michael
225509
225513