List Fields

subscripciones

New Member
I am trying to get field names from one table:

ex:

FOR EACH
TableName NO-LOCK:
CREATE data-
table.
data-table.ColumnName = ¿?
.
END.

Table Columns (column1, column2, column3)


Thanks
 
It sounds as if you might want to learn about dynamic queries.

There are lots of posts here, kbase entries on PSDN and fairly good documentation in the Progress docs. I'd start by looking up the "buffer object handle" and "query object handle" in the docs. Then I'd try working with a code example.
 
I am trying to get field names from one table:

ex:

FOR EACH TableName NO-LOCK:
CREATE data-table.
data-table.ColumnName = ¿?.
END.

Table Columns (column1, column2, column3)


Thanks

You can use the buffer handle of the table to loop around each field of a table and grab the field name (and value if you so require):

Code:
DEFINE VARIABLE hBuffer AS HANDLE      NO-UNDO.
DEFINE VARIABLE iLoop   AS INTEGER     NO-UNDO.
DEFINE VARIABLE hField  AS HANDLE      NO-UNDO.
 
hBuffer = BUFFER customer:HANDLE.
 
FIND FIRST customer NO-LOCK NO-ERROR.
 
DO iLoop = 1 TO hBuffer:NUM-FIELDS:
 
    hField = hBuffer:BUFFER-FIELD(iLoop).
 
    MESSAGE 
        hField:NAME SKIP
        hField:BUFFER-VALUE
        VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

Is this what you're after?
 
You can use the buffer handle of the table to loop around each field of a table and grab the field name (and value if you so require):

Code:
DEFINE VARIABLE hBuffer AS HANDLE      NO-UNDO.
DEFINE VARIABLE iLoop   AS INTEGER     NO-UNDO.
DEFINE VARIABLE hField  AS HANDLE      NO-UNDO.
 
hBuffer = BUFFER customer:HANDLE.
 
FIND FIRST customer NO-LOCK NO-ERROR.
 
DO iLoop = 1 TO hBuffer:NUM-FIELDS:
 
    hField = hBuffer:BUFFER-FIELD(iLoop).
 
    MESSAGE 
        hField:NAME SKIP
        hField:BUFFER-VALUE
        VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

Is this what you're after?



Excelent!!!

Thank You So Much!!!
 
Back
Top