Consultor Eletrônico



Kbase P117164: 4GL/ABL: Procedure to generate proutil idxbuild UNIX script for all table indexes.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/12/2008
Status: Verified

GOAL:

4GL/ABL: Procedure to generate proutil idxbuild UNIX script for all table indexes.

GOAL:

How to generate proutil idxbuild UNIX script using 4GL?

FACT(s) (Environment):

Progress 7.x
Progress 8.x
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Database
UNIX

FIX:

The following 4GL sample procedure demonstrates how to generate a UNIX script to perform an index build for each index in each user table of the database. To generate the script, connect to the database and run this 4GL procedure from the Procedure Editor:
/* idxbuild.p */
output to idxbuild.
put "echo Wait and check on termination $0.log" skip.
for each _file where not _file._file-name begins "_":
put unformatted
"echo Processing all indexes from table " _file._file-name "..."
skip.
put unformatted
"proutil " dbname " -C idxbuild -TB 24 -TM 32 -B 512 <<EOF>> $0.log"
skip
"Some" skip.
for each _index of _file:
put unformatted _file._file-name skip.
put unformatted _index._index-name skip.
end.
put
"!" skip
"y" skip
"y" skip
"EOF" skip.
put "if [ $? -ne 0 ]" skip
"then" skip
" grep \"\\*\\*\" $0.log" skip
" exit" skip
"fi" skip(1).
end.
put skip "grep \"~\*~\* \" $0.log" skip.
quit.