Consultor Eletrônico



Kbase P168369: How to modify the behaviour of a ProDataSet to return only the first or last record in a child table
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   6/18/2010
Status: Unverified

GOAL:

How to modify the behaviour of a ProDataSet to return only the first or last record in a child table within a parent-child relationship?

GOAL:

How to populate a child temp-table in a ProDataSet with only the first record that matches data from its parent?

GOAL:

How to modify the behaviour of a ProDataSet to populate a child temp-table with only the first record matching data from its parent?

GOAL:

Is it possible to use FOR FIRST to populate a temp-table in a ProDataSet?

GOAL:

How to modify the behaviour of a ProDataSet so that the following phrasing is formed in order to return only the first or last record in a child table within a parent-child relationship?

FOR EACH customer where custnum = 1.
FOR FIRST / LAST order (OF customer).

FACT(s) (Environment):

OpenEdge 10.1x
OpenEdge 10.2x
All Supported Operating Systems

FIX:

It is not possible to achieve this using standard ProDataSet operations. The ProDataSet FILL code does its own scan over all the records selected in the query. Furthermore, an OPEN QUERY or QUERY-PREPARE statement will only accept FOR/PRESELECT EACH so it is not possible to use a FOR FIRST on its own.

This functionality can be achieved using callback procedures on the ProDataSet. An example of this is included in the Note below.