Subject Re: [firebird-support] How to check whether a table exists or not?
Author Ann W. Harrison
car.toper wrote:
> I am putting together my first database script for
> Interbase 7.5. Since I am still in development, I
> would like the script to first delete the tables
> and named contraints IF they exist. How might I do that?
>

One way that works across Firebird and Interbase is
to query the system tables.

To determine if table xyz exists:

Select count(*) from rdb$relations
where rdb$relation_name = 'XYZ';

Note that for tables that don't use quoted names
you must ask for the table in upper case. For table
names that are used with quotes, use the name string
in the case that used to define the table.

Good luck,

Ann