Consultor Eletrônico



Kbase P163683: Recursive data-relation cannot fill only top-level data
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   14/04/2010
Status: Unverified

SYMPTOM(s):

Recursive data-relation cannot fill only top-level data

Recursive data-relation always fills at least one level of data below the top level

Dataset has a recursive data-relation defined

The FILL() operation fills the top-level data, and at least one level of data below that

Setting MAXIMUM-LEVEL attribute for data-relation to 0 causes all levels of recursion in the data to be filled

FACT(s) (Environment):

OpenEdge 10.1C
OpenEdge 10.2x
All Supported Operating Systems
Deactivating the recursive data-relation will cause the FILL() to only get the top-level records

CAUSE:

Enhancement Request# 0000004032

FIX:

This Enhancement has not been implemented in the product.

To get the desired behavior, instead of setting the MAXIMUM-LEVEL attribute directly, use code similar to the following:

IF iLevel = 0 THEN
dataset dsMyDataset:get-relation('drMyDatarelation':U):ACTIVE = no.
ELSE
ASSIGN dataset dsMyDataset:get-relation('drMyDatarelation':U):ACTIVE = yes
dataset dsMyDataset:get-relation('drMyDatarelation':U):MAXIMUM-LEVEL = (IF iLevel = ? THEN 0 ELSE iLevel).

Where iLevel is an integer variable or parameter.

Using this code:
If iLevel = 0, the relation will be de-activated completely, which stops any recursion from taking place.
If iLevel = ?, the relation will recurse indeterminately until no more child records are found.
If iLevel is any other value, the maximum level of recursion will be that value.