Kbase P132086: 4GL/ABL: How to display table CRC values for multiple connected databases?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  04/06/2008 |
|
Status: Unverified
GOAL:
4GL/ABL: How to display table CRC values for multiple connected databases?
GOAL:
How to list table CRC values for several connected databases?
GOAL:
How to report table CRC values for each of two or more connected databases?
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
FIX:
Running the following Driver.p procedure will generate a table CRC values report for each of the connected databases. Since the changes made to a database ALIAS do not take effect within the same procedure, a second procedure ReportCRC.p is required:
/* 1. Procedure Driver.p creates the ALIAS "DICTDB" for each connected database and runs the reporting procedure ReportCRC.p */
DEFINE VARIABLE iNumDatabases AS INTEGER NO-UNDO.
DEFINE VARIABLE cCurrentDatabase AS CHARACTER NO-UNDO.
DO iNumDatabases = 1 TO NUM-DBS:
cCurrentDatabase = LDBNAME(iNumDatabases).
CREATE ALIAS "DICTDB" FOR DATABASE VALUE(cCurrentDatabase).
RUN ReportCRC.p.
DELETE ALIAS "DICTDB".
END.
/* 2. Procedure ReportCRC.p generates the table CRC values report for the current database */
DEFINE VARIABLE cCRCReportName AS CHARACTER NO-UNDO.
ASSIGN
cCRCReportName = LDBNAME ("DICTDB") + "TableCRCValues.txt".
OUTPUT TO VALUE(cCRCReportName).
/* Put the header line */
PUT UNFORMATTED
"Database Name" AT 1
"Table Name" AT 20
"Table CRC Value" AT 45 SKIP.
/* Output the current table CRC values */
FOR EACH DICTDB._File WHERE DICTDB._File._Tbl-Type = "T":
PUT UNFORMATTED
LDBNAME ("DICTDB") AT 1
DICTDB._File._file-Name AT 20
DICTDB._File._CRC AT 45 SKIP.
END.
OUTPUT CLOSE.