Consultor Eletrônico



Kbase 20483: Errors: 9047/9058/9049 when using Temp-table Object Methods
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Verified

SYMPTOM(s):

This solution explains why you might receive the following error messages if you define source-table-hndl-exp for Temp-table Object Methods such as CREATE-LIKE and ADD-FIELDS-FROM as Progress documentation indicates:

Unable to CREATE-LIKE for TEMP-TABLE--try using a smaller source table. (9047)

TEMP-TABLE method could not find LIKE table from BUFFER handle. (9058)

Unable to ADD-FIELDS-FROM for TEMP-TABLE. (9049)

FIX:

Documentation for the CREATE-LIKE and ADD-FIELDS-FROM temp-table object methods directs two possible parameters to be used:

- source-table-hndl-exp

- source-table-name-exp
The definition for source-table-hndl-exp in documentation states:

source-table-hndl-exp

An expression that evaluates to a table handle from which to copy the field definitions and, optionally, the indexes if source-index-name-exp is not specified.

This information should actually refer to a buffer handle, and not to a table handle object.

Examples of the syntax that leads to the errors are as follows.

Example 1:

DEFINE VARIABLE tt AS HANDLE NO-UNDO.

CREATE TEMP-TABLE tt.
tt:CREATE-LIKE(BUFFER customer:TABLE-HANDLE).
tt:TEMP-TABLE-PREPARE("tt").
In this example the right parameter to CREATE-LIKE should be:

tt:CREATE-LIKE(BUFFER customer:HANDLE).
Example 2:

DEFINE VARIABLE tt AS HANDLE NO-UNDO.

DEFINE TEMP-TABLE ttFirst
FIELD ttFirst-Code AS CHARACTER.

CREATE TEMP-TABLE tt.
tt:CREATE-LIKE(TEMP-TABLE ttFirst:HANDLE).
tt:TEMP-TABLE-PREPARE("tt").
In this example the right parameter to CREATE-LIKE should be:

tt:CREATE-LIKE(TEMP-TABLE ttFirst:DEFAULT-BUFFER-HANDLE).
For a complete example on the CREATE-LIKE method, refer to the documentation of the CREATE TEMP-TABLE statement.