Kbase P124419: 4GL/ABL: The Buffer object handle KEYS attribute returns 'rowid'.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Verified
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1B
SYMPTOM(s):
4GL/ABL: The Buffer object handle KEYS attribute returns 'rowid'.
Executing code similar to following returns 'rowid':
DEFINE TEMP-TABLE ttCustomer
FIELD cFirst AS CHARACTER
FIELD cLast AS CHARACTER
FIELD iAge AS INTEGER
FIELD iWeight AS INTEGER
INDEX cIndex IS PRIMARY cFirst cLast
INDEX iIndex iAge.
MESSAGE BUFFER ttCustomer:KEYS
VIEW-AS ALERT-BOX INFO BUTTONS OK.
Accessing the KEYS attribute of a TEMP-TABLE Buffer.
The TEMP-TABLE is defined with a PRIMARY Index.
The PRIMARY Index TEMP-TABLE is NOT defined as UNIQUE.
CAUSE:
This is the expected behavior because for a temp-table buffer, the KEYS attribute evaluates to a list of fields in the temp-table?s UNIQUE PRIMARY. If it has no UNIQUE PRIMARY index, then the value returned by KEYS attribute defaults to the string 'rowid'.
FIX:
Ensure that the PRIMARY index is also defined as UNIQUE if it is desired to have the the KEYS attribute return the list of the fields comprising that index. For example, executing code similar to the following returns the list 'cFirst,cLast':
DEFINE TEMP-TABLE ttCustomer
FIELD cFirst AS CHARACTER
FIELD cLast AS CHARACTER
FIELD iAge AS INTEGER
FIELD iWeight AS INTEGER
INDEX cIndex IS PRIMARY UNIQUE cFirst cLast
INDEX iIndex iAge.
MESSAGE BUFFER ttCustomer:KEYS
VIEW-AS ALERT-BOX INFO BUTTONS OK.