Subject Re: [firebird-support] How to find out where the Domains are used
Author Helen Borrie
At 04:41 PM 26/08/2009, you wrote:
>Hi all
>
>I have create a few domains. Now when I need to update a domain for a field I would like to know what all places it has been used so I know the effects of the alter to the domain. Based on this I can decide if the fields warrants a new domain instead.

select
rdb_rf.rdb$relation_name TABLENAME,
rdb_rf.rdb$field_name FIELDNAME,
rdb_f.rdb$field_name DOMAINNAME
from rdb$relation_fields rdb_rf
join rdb$fields rdb_f
on rdb_f.rdb$field_name = rdb_rf.rdb$field_source
where
/* Get all domains */
-- rdb_rf.rdb$field_source not starting with 'RDB$'
/* Get specified domain */
rdb_rf.rdb$field_source = ?
order by 1, 2, 3

Is there any reason why you cannot write such queries yourself? The system tables are regular Firebird tables and are documented...

The main columns in the system tables haven't changed since the IB 6 Beta LangRef was written (find link in the Documentation Index); The Firebird Book (which you have to pay for) has a whole Appendix on the system tables, with info up to Fb 1.5; and the Firebird Book Supplement (also not free unless you bought The Book from IBPhoenix) has updates for Fb 2.0 and 2.1.

./heLen