Subject | Re: [firebird-support] How to check whether a table exists or not? |
---|---|
Author | Ann W. Harrison |
Post date | 2009-05-06T21:57:05Z |
car.toper wrote:
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
> I am putting together my first database script forOne way that works across Firebird and Interbase is
> 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?
>
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