Kbase P159769: How to create an input file from a 4GL session to run DBTOOL to do an SQL Width Scan w/Fix Option fo
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  25/01/2011 |
|
Status: Verified
GOAL:
How to run DBTOOL SQL Width Scan w/Fix Option for all Tables of a database from a script.
GOAL:
How to run DBTOOL Record Validation using Table number from a script.
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.1E
OpenEdge 10.x
FIX:
NOTE: Before running this program be sure there is enough disk space on the system, as there will be a file generated for each table in the database. The size of the file is dependent upon the logging level that is chosen and the number of records in the table. This program used the least verbose logging level.
The following line of code from the program listing sets up the DBTOOL run time parameters in the input.txt file.
PUT UNFORMATTED "9~n2~n1~n20~n" + STRING (_file-number) + "~n0".
A legend for the parameters for the above line is:
9 = Enable file logging.
~n = carriage return.
2 = SQL Width Scan w/Fix Option.
1 = Connection Type (0 = single-user, 1 = Self-service)
% = (Enter the desired Padding % above the Current Max)
~n= carriage return.
_file-number = is the table number supplied by the program.
0 = Logging Level (0,1,2, and 3) 0 is the least verbose, 3 is most verbose and generally reserved for development.
The following line of code from the PROGRAM LISTING BELOW, must be edited to reflect the name of your database instead of the Sports2000 demo database:
OS-COMMAND SILENT VALUE ("dbtool Sports2000 < input.txt").
The program generates file logs with names using the format of "dbtool_ + _file-name", where _file-name is the name of the database table. For example: dbtool_customer:
========== PROGRAM LISTING FOLLOWS ==============
FOR EACH _file NO-LOCK WHERE _Tbl-Type = "T":
OUTPUT TO Value("input.txt").
PUT UNFORMATTED "9~n2~n1~n20~n" + STRING (_file-number) + "~n0".
OUTPUT CLOSE.
OS-COMMAND SILENT VALUE ("dbtool Sports2000 < input.txt").
OS-RENAME VALUE ("dbtool.out") value ("dbtool_" + _file-name).
END.
========= example of the input file created by the above script =======
9
2
1
20
20
0
========= sample output for a single table ===========
Total records read: 0
SQLWidth errors found: 0, Date errors found: 0
SQLWidth errors fixed: 0