Subject RE: [firebird-support] What programming languages and toolkits do you use to access Firebird?
Author Mercea Paul
bartsmissaert@... wrote:
> Thanks, will try that.
> I don't need the exactl number; only a rough
> estimate of the total rows in a table.


You can achieve this:

CREATE TABLE TABLESROWS (
TABLE_NAME VARCHAR(31),
TABLE_ROWS INTEGER
);

and make triggers on interested table like:
SET TERM ^ ;

CREATE OR ALTER TRIGGER mytable_COUNTROWS FOR mytable
ACTIVE AFTER INSERT POSITION 0
AS
begin
if (not exists(select 1 from tablesrows t where t.table_name='mytable')
then
insert into tablesrows (table_name, table_rows) values ('mytable',1);

update tablesrows set table_rows = (select count(id) from mytable);
end
^

SET TERM ; ^

Regards,
Paul