G
gumbytech
Hi,
I am attempting to replace what I would normally be able
to do easily with joins in SQL, with relations and
rowfilters. But I am unable to see how to do the following:
I would like to select rows from a parent table based on
values in two or more child tables.
As an example let us say that I have a parent table
PetOwners, (with cols OwnerID, DogID, CatID)
with two child tables DogNames(with cols DogID, DogName)
and CatNames(with cols CatID, CatName). I have relations
from each parent column to the appropriate child table
columns (RelOwnerDog and RelOwnerCat).
I want to do a rowfilter for Owners that accomplishes:
rowfilter = "(DogName='Betsy') AND (CatName='Corky')"
So in effect I want something like
DataView dvOwnerDogCat = new DataView["PetOwners"];
//define relations (not shown)
dvOwnerDogCat.rowfilter=(Child(RelOwnerDog).
("DogName='Betsy'")) and (Child(RelOwnerCat).=
("CatName='Corky'");
Ignoring the sillyness of the example: Is it possible to
achieve this kind of filter via relations? Can you row
filter on two relations at once? Documentation seems to
indicate that you can but I have been unable to find an
example and have been unable to chance upon the
appropriate syntax.
Thanks in advance
I am attempting to replace what I would normally be able
to do easily with joins in SQL, with relations and
rowfilters. But I am unable to see how to do the following:
I would like to select rows from a parent table based on
values in two or more child tables.
As an example let us say that I have a parent table
PetOwners, (with cols OwnerID, DogID, CatID)
with two child tables DogNames(with cols DogID, DogName)
and CatNames(with cols CatID, CatName). I have relations
from each parent column to the appropriate child table
columns (RelOwnerDog and RelOwnerCat).
I want to do a rowfilter for Owners that accomplishes:
rowfilter = "(DogName='Betsy') AND (CatName='Corky')"
So in effect I want something like
DataView dvOwnerDogCat = new DataView["PetOwners"];
//define relations (not shown)
dvOwnerDogCat.rowfilter=(Child(RelOwnerDog).
("DogName='Betsy'")) and (Child(RelOwnerCat).=
("CatName='Corky'");
Ignoring the sillyness of the example: Is it possible to
achieve this kind of filter via relations? Can you row
filter on two relations at once? Documentation seems to
indicate that you can but I have been unable to find an
example and have been unable to chance upon the
appropriate syntax.
Thanks in advance