KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Utility Method to Count All Project Tables and Records
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: September 26, 2025
The following method count all database tables and records.
#DECLARE() : Text

var $text_t : Text
var $lastTable_l; $i : Integer

$lastTable_l:=Last table number
For ($i; 1; $lastTable_l)
   If (Is table number valid($i))
    $text_t:=$text_t+Table name($i)+Char(Tab)+\
      String(Records in table(Table($i)->))+Char(Carriage return)
   End if
End for

return $text_t

Example:

var $output : Text
$output:=Util_countTablesAndRecords

SET TEXT TO PASTEBOARD($output)


Output can be pasted into Notepad, or any text editor for easy review.