Keywords as column names in tables

dman123

New Member
Hello. Does anyone know how to get the value of a field when the field name is a keyword WITHOUT using the KeywordForget functionality?

For example:
We have a table t which has a column named ALIAS.
The following code will not compile because ALIAS is a keyword...

FOR EACH t:
DISPLAY t.ALIAS.


Thank you.
David Wallin
 
I'd rename the column.

How did you manage to create such a column in the first place?

I don't have any such columns to test with but you might try manipulating it via a dynamic query and using dynamic widgets.
 
Here's an example equivalent to ibfObjectProperty.Value = ichValue.

Code:
  assign
                                                   /* ibfObjectProperty.Value */
      ihnBuffer = buffer ibfObjectProperty:handle
      ihnField = ihnBuffer:BUFFER-FIELD(4)
      ihnField:BUFFER-VALUE = ipchValue
      .

where ihnBuffer and ihnField are handles and Value is the fourth column in the table ObjectProperty for which ibfObjectProperty is a buffer.

But, Tom's right. If you have control of the schema, bite the bullet and rename the field. In the example above, which is from my ABL2UML work, I don't have control of the schema so there is no choice.
 
Back
Top