R
Rob Fitzpatrick
Guest
Here's another approach, using the cardinality stats. It would be accurate once you hacve run "UPDATE TABLE STATISTICS" for each table. It is lightly tested on sports, giving the same totals as tabanalys and ABL. Caveat: it would have to be rewritten to work on a partitioned DB. define temp-table table-stat no-undo field file-number as integer format "->>>>9" label "Tbl#" field file-name as character format "x(32)" label "Table name" field rec-count as int64 format ">>>,>>>,>>>,>>>" label "Record count" field stats-dt as datetime label "Update Stats date" index file-number as unique file-number index file-name file-name . for each dictdb._file no-lock where _file._file-number > 0 and _file._file-number < 32768, each dictdb._systblstat no-lock where _systblstat._tblid = _file._file-number: find table-stat no-lock where table-stat.file-number = _file._file-number no-error. if not available( table-stat ) then do: create table-stat. assign table-stat.file-number = _file._file-number table-stat.file-name = _file._file-name . end. case _systblstat._property: when 2 then table-stat.stats-dt = _systblstat._val_ts. when 4 then table-stat.rec-count = _systblstat._value. end case. end. for each table-stat no-lock use-index file-name: display table-stat. end.
Continue reading...
Continue reading...