Subject Re: [firebird-support] Dropp table if exists
Author Almond
A not very good method is query the system table.

SELECT RDB$RELATION_NAME as tablename
FROM RDB$RELATIONS WHERE RDB$SYSTEM_FLAG=0
AND RDB$RELATION_NAME = 'TABLE_TO_DROP';

If the query result is not null, then drop the table.

Is this correct ?


At 14:00 2005.03.02, Dimitry Sibiryakov wrote:

>On 1 Mar 2005 at 19:22, David Winslow wrote:
>
> >I cannot figure out how to check if a object already exists and if it
> >does drop it
> >
> >Does anyone know how this should be done?
>
> I simply issue DROP command and ignore "object not found" errors.
>
> >Also if there is a dependency how do I make sure that the objects are
> >all deleted ?
>
> If you want delete _all_ objects - drop database and create a new
>one.
>--
> SY, Dimitry Sibiryakov.
>
>
>
>
>Yahoo! Groups Links
>
>
>
>