D
David Veeneman
I'm trying to figure out how best to solve the following problem: I have a
database with two tables, Projects and Steps, that I want to read into a
dataset. Projects contain Steps, so I will create a data relation between
the two tables. Here's the twist: When I fill the dataset, I don't want to
retrieve all Projects. I only want the Projects that are owned by a
particular person, those that have a particular OwnerID value.
I can fill both tables into my dataset with no filtering, then create the
data relation I need. But if I filter the Projects table on its OwnerID
field when I read it from the database, then the Steps table will contain
Steps that don't correspond to Projects, which will cause a referential
integrity error (I think). So, that leaves me with a couple of options:
-- First, I could load the dataset without filtering, set the data relation,
then create a data view that filters the dataset on the Project table's
OwnerID field.
-- Or, I could add an OwnerID field to the Steps table in the database, so
that I can filter both tables on the OwnerID field when I read them from the
database.
Here is my question: Is one of these approaches clearly better than the
other? Or is there a third approach that I haven't thought of, which works
better than either of these options?
Thanks in advance for your help.
David Veeneman
Foresight Systems
database with two tables, Projects and Steps, that I want to read into a
dataset. Projects contain Steps, so I will create a data relation between
the two tables. Here's the twist: When I fill the dataset, I don't want to
retrieve all Projects. I only want the Projects that are owned by a
particular person, those that have a particular OwnerID value.
I can fill both tables into my dataset with no filtering, then create the
data relation I need. But if I filter the Projects table on its OwnerID
field when I read it from the database, then the Steps table will contain
Steps that don't correspond to Projects, which will cause a referential
integrity error (I think). So, that leaves me with a couple of options:
-- First, I could load the dataset without filtering, set the data relation,
then create a data view that filters the dataset on the Project table's
OwnerID field.
-- Or, I could add an OwnerID field to the Steps table in the database, so
that I can filter both tables on the OwnerID field when I read them from the
database.
Here is my question: Is one of these approaches clearly better than the
other? Or is there a third approach that I haven't thought of, which works
better than either of these options?
Thanks in advance for your help.
David Veeneman
Foresight Systems