Subject Re: [firebird-support] slow "where 1=0"
Author Ivan Prenosil
> I use to run
>
> select * from TABLE where 1=0
>
> to fill an empty datataset with fields structure of any table. The
> thing is that Firebird needs a little while (sometimes a few seconds)
> to do it

If you want to know only the structure, not data, then simply
do not execute the query, just prepare it
(then using only "select * from TABLE" is o.k.).

Alternatively, if you really want to execute the query
(e.g. because of components limitation), and you want to modify
only WHERE clause (i.e. you do not want SELECT FIRST 0 etc.),
then universal query not depending on table structure is this

SELECT * FROM TAB WHERE RDB$DB_KEY=0

Ivan
http://www.volny.cz/iprenosil/interbase/