Consultor Eletrônico



Kbase P100877: Errors on ProDataSet GET-CHANGES() method using new parent-mode option
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/03/2005
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.0B

SYMPTOM(s):

Source ProDataSet contains multiple tables

Data-relations defined between tables in source ProDataSet

Table names in changes ProDataSet are the same as in the source ProDataSet

Calling GET-CHANGES() method with the parent-mode set to TRUE

The following errors occur:

Cannot REPLACE a temp-table buffer when the source and target buffers have the same name <table name>

Found unexpected error while getting changes (11981)

CAUSE:

This is expected behavior.

When a row is changed while TRACKING-CHANGES = TRUE, the ROWID of the row is saved in the origin-ROWID. Therefore, the 4GL client can access this directly instead of "navigating" to it.
However, when the parent-mode is TRUE, the 4GL has to construct one or more queries with WHERE clauses to find the parents, because no ROWID for the parents has been saved. The WHERE requires that the names of the tables can't be the same.

FIX:

Ensure the temp-tables in the changes dataset are different from the ones in the source dataset.

A common approach is to create the changes dataset dynamically using the CREATE-LIKE() method; in this scenario unique temp-table names can be achieved by specifying the name-prefix, for example:

hChangesDataset:CREATE-LIKE( DATASET SourceDataset:HANDLE, "change").