Consultor Eletrônico



Kbase P121200: 4GL/ABL/SQL: How to calculate the number of locks needed to execute UPDATE ALL COLUMN STATISTICS sta
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   02/01/2009
Status: Verified

GOAL:

4GL/ABL/SQL: How to calculate the number of locks needed to execute the UPDATE ALL COLUMN STATISTICS statement using 4GL/ABL?

GOAL:

How to programmatically approximate the number of locks needed to execute the UPDATE ALL COLUMN STATISTICS statement against a Progress/OpenEdge database?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

The 4GL code displays the approximate number of locks needed to execute the UPDATE ALL COLUMN STATISTICS statement against the sports2000 database:
DEFINE VARIABLE iIndexFieldCount AS INTEGER NO-UNDO.
DEFINE VARIABLE iNumberOfLocksRequired AS INTEGER NO-UNDO.
Loop:
FOR EACH _File NO-LOCK WHERE _Tbl-Type = "T",
EACH _Index NO-LOCK OF _File,
EACH _Index-Field OF _Index:
FIND _Field OF _Index-Field NO-LOCK NO-ERROR.
IF AVAILABLE (_Field) THEN
ASSIGN
iIndexFieldCount = iIndexFieldCount + 1.
ELSE
NEXT Loop.
END.
ASSIGN
iNumberOfLocksRequired = iIndexFieldCount * 11.
MESSAGE iNumberOfLocksRequired
VIEW-AS ALERT-BOX INFO BUTTONS OK.