In Caché you can do it in the way like below.
calcAll() public {
set sql="SELECT STRING(TABLE_SCHEMA, '.', TABLE_NAME) TableName, ClassName "_
"FROM INFORMATION_SCHEMA.TABLES "_
"WHERE TABLE_TYPE LIKE '%BASE%' AND TABLE_SCHEMA NOT LIKE 'Ens%'"
set statement=##class(%SQL.Statement).%New()
set sc=statement.%Prepare(sql)
set rs=statement.%Execute()
while rs.%Next() {
set tableName=rs.TableName
set className=rs.CLASSNAME
set cnt=$$count(tableName)
write !,className," - ",cnt
}
}
count(table) public {
set sql="SELECT count(*) Cnt FROM "_table
set statement=##class(%SQL.Statement).%New()
set sc=statement.%Prepare(sql)
set rs=statement.%Execute()
set count=0
if rs.%Next() {
set count=rs.Cnt
}
quit count
}
You can create some mac routine, like `count.mac`, and put my code there
after call, you will information about number of rows in every class
SAMPLES>d ^count
Aviation.Aircraft - 1215
Aviation.Crew - 1382
Aviation.Event - 1200
Aviation.Cubes.Aircraft.Fact - 0
Aviation.Cubes.Aircraft.Listing - 0
Aviation.Cubes.Aircraft.StarAircraftCategory - 0
Aviation.Cubes.Aircraft.StarAircraftManufacturer - 0
Aviation.Cubes.Aircraft.StarAircraftModel - 0
Aviation.Cubes.Aircraft.StarDamage - 0
Aviation.Cubes.Aircraft.StarFlightType - 0
Aviation.Cubes.Crew.Fact - 0
Aviation.Cubes.Crew.Listing - 0
Aviation.Cubes.Crew.StarAge - 0
Aviation.Cubes.Crew.StarAgeRg814105347 - 0
Aviation.Cubes.Crew.StarCategory - 0
Aviation.Cubes.Crew.StarInjury - 0
Aviation.Cubes.Crew.StarMedicalCertification - 0
Aviation.Cubes.Crew.StarSex - 0
Aviation.Cubes.Events.Fact - 0
Aviation.Cubes.Events.Listing - 0
Aviation.Cubes.Events.Star3610825905 - 0
Aviation.Cubes.Events.Star627747261 - 0
Aviation.Cubes.Events.StarInjuriesHighest - 0
Aviation.Cubes.Events.StarMidAir - 0
Aviation.Cubes.Events.StarSkyConditionNonCeiling - 0