Consultor Eletrônico



Kbase P116074: A buffer cannot be created FOR a database table with different field names.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/16/2011
Status: Unverified

SYMPTOM(s):

A buffer cannot be created FOR a database table with different field names.

There is no way in 4GL to define a buffer for a database table while using a different field name. For example:

DEFINE BUFFER xxgrp_mstr FOR usrw_wkfl
WHERE usrw_key1 = "xxgrp_mstr".

Trying to modify the buffer field NAME attribute or BUFFER-NAME attribute results in error 4052.

**<attribute> is not a <settable/queryable> attribute for <widget id>. (4052)

** NAME is not a settable attribute for BUFFER_FIELD widget. (4052)

CAUSE:

It is not possible to use the 4GL in this way. The syntax does not allow it.

FIX:

To achieve this, use a dynamic Temp Table and the ADD-LIKE-FIELD method. This way the field can be added like a database field, but the field name can be anything. For example:

DEFINE VARIABLE fld1 AS HANDLE.
DEFINE VARIABLE bh AS HANDLE NO-UNDO.
DEFINE VARIABLE tth AS HANDLE NO-UNDO.

CREATE TEMP-TABLE tth.
tth:ADD-LIKE-FIELD("NEW_ordno","order.order-num").
tth:TEMP-TABLE-PREPARE("dynOrder").
bh = tth:DEFAULT-BUFFER-HANDLE.
fld1 = bh:BUFFER-FIELD("NEW_ordno").
MESSAGE fld1:NAME VIEW-AS ALERT-BOX INFO BUTTONS OK.