Consultor Eletrônico



Kbase P87907: Will a child table in a dataset with its own query respect relationships?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/3/2009
Status: Verified

GOAL:

Will a child table in a dataset with its own query respect relationships?

FACT(s) (Environment):

OpenEdge 10.x
All Supported Operating Systems

FIX:

The short answer is that yes, it will.

The longer answer is more complex.

If a child table in a dataset uses a query that you have defined (instead of letting the dataset automatically define the query based on the relationships) then during the FILL the child table is considered to be a "top level" table and it will be filled only with the data that is returned from its query (whatever data that may be). Relationships will NOT be respected during the FILL because you have told the the dataset to ignore relationships by manually defining what the query will be that the table is to use to obtain records. The end result of this is that by manually defining the query the table MAY end up with more (or less) records in it than it would have had if the query had been automatically generated by the dataset based on the defined relationships.

So, during a FILL a child table will not respect defined relations IF it has its own query defined by you (the developer).

However, once the dataset has been built and detached from all data source objects the defined relationships will be used. So, when you want to see the related child records use GET-RELATION(n):QUERY to obtain the automatically generated query (which respects the defined relationships). This will allow you to see the child data as you would expect (i.e. filtered by the parent record).