Printer FriendlyEmail Article Link

How do I get a quick count of rows in each table in an Informix database?

Answer

Below is a short script that will give a count of entries in each table where the table id is above 99.

select tabname, nrows
from systables
where tabid > 99
order by tabname;


access_point             15987
acna                        91
all_prefixes                 0
annotation                   1
brtu                         0
circuit                   7707
ckttypes                    14
class                       48
customer                     6
customer_history          9385
enable_pm_aids               0
enable_pm_defaults           1
enable_pm_log                0
enableaidsadded              5
.
.
.
or

dbaccess <<!
database pmint;
select *
from version_info;

select tabname, nrows
from systables
where tabid > 99 order by tabname;
!


Product : Informix