Subject Re[2]: [firebird-support] Count records in tables
Author Bjoern Reimer
Hi,


this is better if you have mixed case table names:


CREATE PROCEDURE SP_SERVERISTATISTIK
RETURNS (
TABLOAD VARCHAR(50),
SIZE BIGINT)
AS
begin
for
SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS
WHERE
(RDB$RELATION_NAME NOT LIKE 'RDB$%')
and
(RDB$VIEW_SOURCE IS NULL)
INTO
:TABLOAD
DO
BEGIN
execute statement 'SELECT CAST(COUNT(*) AS BIGINT) FROM "' || TABLOAD || '"'
INTO :SIZE;
suspend;
END
end






Björn

--
Björn Reimer -- RRZE
Tel: +49-9131 - 85-27809
Fax: +49-9131 - 302941
Martensstr. 1 / 2.021
D - 9 1 0 5 8 Erlangen
www.rrze.uni-erlangen.de