Subject Re: [firebird-support] Re: count records of all tables
Author Daniel Albuschat
2009/12/5 Dimitry Sibiryakov <sd@...>:
>> if you have an idea how this statement will look please write it?
>
>   You must compose EXECUTE BLOCK with EXECUTE STATEMENT inside.

Like this:

set term ^;
execute block returns (table_name varchar(32), record_count integer) as
begin
for select rdb$relation_name from rdb$relations into :table_name do
begin
execute statement "select count(*) from " || :table_name into
:record_count;
suspend;
end
end^

Note: Only valid for Firebird 2.x.

Regards,

Daniel Albuschat

--
eat(this); // delicious suicide