Subject Re: Dumb Question
Author chumlyii
Because I would not wish to type 60 lines when I can do the same
thing with one.



--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 01:12 PM 9/12/2003 +0000, you wrote:
> >In Oracle I'm used to using SQL to create SQL scripts. While I can
> >do the same in Firebird I can't seem to figure out how to run
> >multiple statements as a script.
> >
> >EXAMPLE
> >
> >SELECT MAX(ID) FROM TABLE1;
> >SELECT MAX(ID) FROM TABLE2;
> >SELECT MAX(ID) FROM TABLE3;
>
> Forgetting about scripts for now (presumably you've discovered you
can
> execute a script in isql) -- if you want somehow to list these
maximum
> values in a meaningful way, why not just run a union query:
>
> SELECT 'TABLE1' as tablename, MAX(ID)
> FROM TABLE1
> UNION
> SELECT 'TABLE2' as tablename, MAX(ID)
> FROM TABLE2
> UNION
> SELECT 'TABLE3' as tablename, MAX(ID)
> FROM TABLE3
> UNION
> .....
>
> ?
>
> You could also define a view from these statements and then just
use the
> output as required, with a search condition on the tablename column.
>
> /heLen