Consultor Eletrônico



Kbase P153559: 4GL/SQL:  How to get ( access )  the field names of a given database table using 4GL?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/09/2009
Status: Unverified

GOAL:

4GL/SQL: How to get ( access ) the field names of a given database table using 4GL?

GOAL:

How to list the field names of a given database table using SQL?

FIX:

The following is one way to get the field names of the customer table using 4GL:

FIND _File NO-LOCK WHERE _File-Name = "Customer".
FOR EACH _Field OF _file NO-LOCK:
DISPLAY _Field-Name.
END.
The following is another way to access the field names of the customer table using 4GL:

DEFINE VARIABLE iFieldCount AS INTEGER NO-UNDO.
DO iFieldCount = 1 TO BUFFER Customer:HANDLE:NUM-FIELDS:
MESSAGE BUFFER Customer:HANDLE:BUFFER-FIELD[iFieldCount]:NAME
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

The following is one way to list the field names of the customer table using 4GL:

SELECT
"_Field"."_Field-Name"
FROM
PUB."_Field", PUB."_File"
WHERE
"_File"."_File-Name" = 'customer' AND
"_Field"."_File-recid" = "_File".rowid