Kbase P95630: How to export database table and field validations and validation expressions to a file?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/29/2004 |
|
Status: Unverified
GOAL:
How to export database table and field validations and validation expressions to a file?
FIX:
The following code exports all database table and field validations and validation expressions into two files:
/* Temp table to store table validations */
DEFINE TEMP-TABLE TableValidations
FIELD cTableName LIKE _File._File-Name
FIELD cValExp LIKE _File._Valexp
FIELD cValmsg LIKE _File._Valmsg
INDEX TableName IS PRIMARY cTableName ASCENDING.
/* Temp table to store field validations */
DEFINE TEMP-TABLE FieldValidations
FIELD cTableName LIKE _File._File-Name
FIELD cFieldName LIKE _Field._Field-Name
FIELD cValExp LIKE _Field._Valexp
FIELD cValmsg LIKE _Field._Valmsg
INDEX TableName IS PRIMARY cTableName ASCENDING.
/* Populate file and field validation temp tables */
FOR EACH _File WHERE _Tbl-Type ="T":
CREATE TableValidations.
ASSIGN
cTableName = _File-name
cValExp = _File._Valexp
cValmsg = _File._Valmsg
.
FOR EACH _field OF _file:
CREATE FieldValidations.
ASSIGN
cTableName = _File-name
cFieldName = _Field._Field-Name
cValExp = _Field._Valexp
cValmsg = _Field._Valmsg
.
END.
END.
/* Export table validation to a file */
OUTPUT TO TableValdiations.dat.
FOR EACH TableValidations:
EXPORT TableValidations.
END.
OUTPUT CLOSE.
/* Export field validation to a file */
OUTPUT TO FieldValdiations.dat.
FOR EACH FieldValidations:
EXPORT FieldValidations.
END.
OUTPUT CLOSE.