Subject | Re: [firebird-support] DDL |
---|---|
Author | Milan Babuskov |
Post date | 2005-01-20T16:43:25Z |
Richard Clarke wrote:
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
> Can anyone give me a tip, on how to check to see if a Table alreadyYou can query the system tables like this:
> exists in DDL format ?
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