Kbase 16813: Example: How to get a table & field report of connected DB's
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Example: How to get a table & field report of connected DB's
This Knowledgebase Entry give a code sample, showing how to get a
table and field report of all connected databases.
The following code needs to be two separate programs.
PROGRAM1.P
==========
DEF VAR x AS CHAR.
DEF VAR i AS INTEGER.
DO i = 1 TO NUM-DBS:
x = LDBNAME (i).
CREATE ALIAS "DICTDB" FOR DATABASE VALUE (x).
DISPLAY x LABEL "Database name: ".
RUN PROGRAM2.P.
END.
PROGRAM2.P
==========
FOR EACH dictdb._field, dictdb._file WHERE RECID (_file) = _field._fil
BREAK BY (_file-name).
IF SUBSTRING (_file-name,1,1) = "_" THEN NEXT.
ELSE DO:
IF FIRST-OF (_file-name) THEN
DISPLAY _file-name FORMAT "X(20)" _field-name.
ELSE DISPLAY _field-name.
END.
END.
Progress Software Technical Support Note # 16813