Consultor Eletrônico



Kbase P96926: Temp-table PRIVATE-DATA attribute value lost after passing as parameter
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/19/2009
Status: Verified

SYMPTOM(s):

Assigning a value to a temp-table's PRIVATE-DATA attribute

Passing the temp-table to other procedure using a TABLE or TABLE-HANDLE parameter

In the called procedure the PRIVATE-DATA attribute for the temp-table is unknown (?)

FACT(s) (Environment):

Progress 9.1D
OpenEdge 10.0B
All Supported Operating Systems

CAUSE:

This is expected behavior.

The PRIVATE-DATA attribute is unique to instance of the temp-table object. When passing the temp-table by value a new copy of the temp-table is created, and this new copy does not inherit the PRIVATE-DATA attribute of the original temp-table.

FIX:

An alternative needs to be found to ensure the data is passed around. Options are:

1. Pass the temp-table by reference instead.
This can be done by using a parameter of the HANDLE datatype instead of a TABLE or TABLE-HANDLE parameter, or by using the BY-REFERENCE syntax (introduced for temp-tables in 10.0B)
Passing by reference avoids creating the second temp-table, the called procedure will work on the same temp-table instance and will thus have access to the PRIVATE-DATA.
Note that this is limited to passing temp-tables within the same ABL session; it can not work if one ABL session calls another such as when calling an AppServer agent from an ABL client.

2. Pass the additional data as a separate parameter.
Add an extra parameter to the called procedure which accepts a character string, and pass the value of the PRIVATE-DATA attribute using that parameter.
Alternatively, if the called procedure already accepts a parameter for context-specific data, it may be possible to append the value of PRIVATE-DATA to that.
This approach will work under any circumstance.