Subject | RE: [firebird-support] (unknown) |
---|---|
Author | Alan McDonald |
Post date | 2004-02-21T00:36:57Z |
> What I usually do, is create a SQL statement, that creates a SQLIf I hit my databases with this statement I'd have to take a holiday
> script which in turn does what I want:
>
> select 'SELECT cast('''||rtrim(rdb$relation_name)||''' as
> varchar(100)), count(*) FROM '||rtrim(rdb$relation_name)||' UNION '
> from rdb$relations
>
> will create a SQL Statement that returns all table counts.
>
> You only have to remove the last UNION keyword
>
> If anybody knows if there is a different way to create a UNION with
> one constant field, and a numeric field, other then casting the
> constant to varchar() please let me know
>
> SELECT 'table1', count(*) from table1
> UNION
> SELECT 'table2', count(*) from table2
>
> does not work.
>
>
> Regards
> Thomas
:-)
needless to say I'm not tied mentally to how many records are in any
particular table
Do you put this in your client app?
Alan