From: Fabiano B. <fa...@pe...> - 2006-04-06 20:16:21
|
Ops, maybe it's a IBExpert issue. It seems it runs OK in isql. Maybe someone want to give it a try. Fabiano Bonin escreveu: > Usually, i get a server crash when i run the SP below. > It counts the records of all non-systems tables. > Sometimes it works, but it crashes very often. > Tested with FB 1.5.3 and FB 2.0 RC 1. > > select * from sp_record_count(null); > > > Here is its code: > > set term !! ; > > create or alter procedure sp_record_count ( > p_table_name varchar(31) ) > returns ( > table_name varchar(31), > record_count integer ) > as > begin > for select > a.rdb$relation_name > from > rdb$relations a > where > ( :p_table_name is null or upper(a.rdb$relation_name) = > upper(:p_table_name) ) and > ( a.rdb$relation_name not like 'RDB$%' ) and > ( a.rdb$view_blr is null ) > into > :table_name > do > begin > execute statement 'select count(*) from "' || :table_name || '"' > into :record_count; > suspend; > end > end !! > > set term ; !! > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel > |