USING Progress.Database.*.
OUTPUT TO Arch.out. DEFINE VARIABLE hTableArch AS HANDLE NO-UNDO. DEFINE VARIABLE hbTableArch AS HANDLE NO-UNDO. DEFINE VARIABLE hIndexArch AS HANDLE NO-UNDO. DEFINE VARIABLE hbIndexArch AS HANDLE NO-UNDO. DEFINE VARIABLE i AS INTEGER NO-UNDO INITIAL 1. DEFINE VARIABLE n AS INTEGER NO-UNDO INITIAL 1. DEFINE VARIABLE retOK AS LOGICAL NO-UNDO. DEFINE VARIABLE tth AS HANDLE NO-UNDO. CREATE TEMP-TABLE tth. DEFINE VARIABLE tth2 AS HANDLE NO-UNDO. CREATE TEMP-TABLE tth2. DEFINE VARIABLE hq AS HANDLE NO-UNDO. DEFINE VARIABLE hHdl AS HANDLE NO-UNDO. tth:CREATE-LIKE(TEMP-TABLE ttDept:HANDLE). tth:TEMP-TABLE-PREPARE("tth"). tth2:CREATE-LIKE(TEMP-TABLE ttEmp:HANDLE). tth2:TEMP-TABLE-PREPARE("tth2"). Progress.Database.TempTableInfo:ArchiveTableStatistics = YES. Progress.Database.TempTableInfo:ArchiveIndexStatistics = YES. DELETE OBJECT tth. DELETE OBJECT tth2. hTableArch = Progress.Database.TempTableInfo:GetTableStatHistoryHandle(). hIndexArch = Progress.Database.TempTableInfo:GetIndexStatHistoryHandle(). IF VALID-HANDLE(hTableArch) THEN hbTableArch = hTableArch:DEFAULT-BUFFER-HANDLE. IF VALID-HANDLE(hIndexArch) THEN hbIndexArch = hIndexArch:DEFAULT-BUFFER-HANDLE. create query hq. hHdl = hbTableArch. run PrintArchRecs. hHdl = hbIndexArch. run PrintArchRecs. DELETE OBJECT hq. procedure PrintArchRecs: MESSAGE SKIP hHdl:NAME. hq:SET-BUFFERS(hHdl). hq:QUERY-PREPARE("preselect each " + hHdl:NAME ). hq:QUERY-OPEN(). REPEAT: hq:GET-NEXT(). MESSAGE " ". if hq:QUERY-OFF-END then leave. IF hHdl:NAME = "_TableStatHist" THEN MESSAGE hHdl::_Table-name hHdl::_Prog-name hHdl::_Delete-Timestamp. ELSE MESSAGE hHdl::_Index-name hHdl::_Prog-name hHdl::_Delete-Timestamp. END. /* repeat */ end PROCEDURE. |
_TableStatHist
tth Archive.p 08/05/2011 15:30:56.433 tth2 Archive.p 08/05/2011 15:30:56.433 _IndexStatHist tth.idx1 Archive.p 08/05/2011 15:30:56.433 tth2.idx2 Archive.p 08/05/2011 15:30:56.433 |