Column/Record Count

RD_Man

Member
:) Good morning All,

I am looking for a way to get a list/print of all Tables in a Progress DB (10.01b). The tricky part is also need to get the Column/Record Count for each table.

Is this doable?

Thanks,

Mike
 
/* Hello
Pls check the following snippet code will help u
Regards
Philip P oommen */
DEF VAR cnt AS INT NO-UNDO.
OUTPUT TO c:\X.txt.
FOR EACH _Field NO-LOCK ,
EACH _File OF _Field NO-LOCK WHERE _Tbl-Type = 'T' AND NOT _Hidden
BREAK BY _file._file-name:
cnt = cnt + 1.
DISP _file._file-name _Field-Name _file._file-name WITH FRAME
X NO-BOX NO-LABEL WIDTH 132.
IF LAST-OF(_file._file-name) THEN DO:
DISP cnt.
cnt = 0.
END.

.

END.
OUTPUT CLOSE.
 
Philip,

Thank you for the relpy. the snippet works great and count the columns as asked. BUT I guess I asked the question WRONG.

Is there a way to get the number of records currently saved in each database table.

Thanks,

Mike
 
Works great Tom, Thank you. I am working on getting the same results from code. (Learning Experience)

Bear with me on my terminology:

How can I take a metadata value and address it as a table name?
Example:

OUTPUT TO C:\TableList-RowCount.txt.
REPEAT:
FIND NEXT _file.
REPEAT:
FIND NEXT _file-name. /*<< This _file-name is not evaluated as a table*/
iCount = (iCount + 1).
END.
EXPORT _file-name iCount.
iCount = 0.
END.
OUTPUT CLOSE.

 
To do that sort of thing the old way, you would put the actual record count logic in a separate .p and then pass the file name as a command line argument, i.e., not in parentheses. Then, it does a compile on the fly and binds in the file name as you intended.

But, with any remotely modern version of ABL, you would do this with a dynamic query.

But then, if you care about how fast you get the answer, use dbanalysis!
 
Thanks to all who helped me on this thread. You have taught me more than I ask for (always a good thing). I am new to Progress, Old to code developement. I always prefer to learn the base code first then get fancy.

:) Thanks Again!

Mike
 
Back
Top