Subject Re: [firebird-support] DDL
Author Milan Babuskov
Richard Clarke wrote:
> Can anyone give me a tip, on how to check to see if a Table already
> exists in DDL format ?

You can query the system tables like this:

select 'YES'
from rdb$relations
where rdb$relation_name = 'YOUR_TABLE';

The query would return 'YES' if it exists, and NULL if not. You could even use
it in some stored procedure or trigger like this:

if (exists (
select 1
from rdb$relations
where rdb$relation_name = 'YOUR_TABLE'))
then
do something;
else
do something else;


--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org