Subject Re: [firebird-support] count records of all tables
Author Milan Babuskov
Dimitry Sibiryakov wrote:
>> Is this statement posible in Firebird 2.1?
>
> Yes. But the task seems pointless to me.

It's not bad when you get a completely new database to work with and
want to get some overview about which tables already have records in them.

Anyway, here's the script in case someone needs it:


set term !! ;
execute block
returns (
stm varchar(300),
cnt integer )
as
begin
for
select cast('select count(*) from '||r.RDB$RELATION_NAME as
varchar(300))
from RDB$RELATIONS r
where (r.RDB$SYSTEM_FLAG is null or r.RDB$SYSTEM_FLAG = 0)
and r.RDB$VIEW_BLR is null
order by 1
into :stm
do
begin
execute statement :stm into :cnt;
suspend;
end
END


--
Milan Babuskov

==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================