-- RMGC_TablesRowCount.sql
-- Lists count of rows in each table 
-- If not 22 tables listed, database has corruption
-- 2010-05-26 by ve3meo   


CREATE TEMP TABLE IF NOT EXISTS VariableTable
(
"Table" TEXT,
Rows INTEGER
);
 
INSERT INTO VariableTable
SELECT 'AddressLinkTable', COUNT(1)
FROM AddressLinkTable;

INSERT INTO VariableTable
SELECT 'AddressTable', COUNT(1)
FROM AddressTable;

INSERT INTO VariableTable
SELECT 'ChildTable', COUNT(1)
FROM ChildTable;

INSERT INTO VariableTable
SELECT 'CitationTable', COUNT(1)
FROM CitationTable;

INSERT INTO VariableTable
SELECT 'ConfigTable', COUNT(1)
FROM ConfigTable;

INSERT INTO VariableTable
SELECT 'EventTable', COUNT(1)
FROM EventTable;

INSERT INTO VariableTable
SELECT 'ExclusionTable', COUNT(1)
FROM ExclusionTable;

INSERT INTO VariableTable
SELECT 'FactTypeTable', COUNT(1)
FROM FactTypeTable;

INSERT INTO VariableTable
SELECT 'FamilyTable', COUNT(1)
FROM    FamilyTable;

INSERT INTO VariableTable
SELECT 'GroupTable', COUNT(1)
FROM    GroupTable;

INSERT INTO VariableTable
SELECT 'LabelTable', COUNT(1)
FROM    LabelTable;

INSERT INTO VariableTable
SELECT 'LinkTable', COUNT(1)
FROM    LinkTable;

INSERT INTO VariableTable
SELECT 'MediaLinkTable', COUNT(1)
FROM    MediaLinkTable;

INSERT INTO VariableTable
SELECT 'MultimediaTable', COUNT(1)
FROM    MultimediaTable;

INSERT INTO VariableTable
SELECT 'NameTable', COUNT(1)
FROM    NameTable;

INSERT INTO VariableTable
SELECT 'PersonTable', COUNT(1)
FROM    PersonTable;
 
INSERT INTO VariableTable
SELECT 'PlaceTable', COUNT(1)
FROM    PlaceTable;

INSERT INTO VariableTable
SELECT 'ResearchTable', COUNT(1)
FROM    ResearchTable;

INSERT INTO VariableTable
SELECT 'RoleTable', COUNT(1)
FROM    RoleTable;

INSERT INTO VariableTable
SELECT 'SourceTable', COUNT(1)
FROM    SourceTable;

INSERT INTO VariableTable
SELECT 'SourceTemplateTable', COUNT(1)
FROM    SourceTemplateTable;

INSERT INTO VariableTable
SELECT 'WitnessTable', COUNT(1)
FROM    WitnessTable;

INSERT INTO VariableTable
SELECT 'of 22 tables', COUNT(1)
FROM variabletable;

SELECT Rows, "Table" FROM variabletable;














