Subject Re: [ib-support] Unwanted Domains
Author Todd Brasseur
Thanks Lucas,

I tried your statement but it only showed the domains that I created and
not system generated ones.

I have approx. 50 domains in the system which I created. 2 of which I
haven't used yet and your statement showed me them. Over the 4 years
that I have been working on this system there has been approx. 2500
domains created by the system. I am sure that many of these are not in use.

Todd

Lucas Franzen wrote:

>
>
> Todd Brasseur schrieb:
> >
> > Is there a quick way of getting rid of all domains in a database that
> > aren't used by anything?
>
> Todd,
>
> To get a list of all unused domains you could do:
>
> SELECT F.RDB$FIELD_NAME FROM RDB$FIELDS F
> WHERE
> F.RDB$SYSTEM_FLAG = '0'
> AND F.RDB$FIELD_NAME NOT STARTING WITH 'RDB$'
> AND NOT EXISTS (
> SELECT RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS R
> WHERE R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME )
>
>
>
> I tested on a database:
> DELETE FROM RDB$FIELDS F
> WHERE
> F.RDB$SYSTEM_FLAG = '0'
> AND F.RDB$FIELD_NAME NOT STARTING WITH 'RDB$'
> AND NOT EXISTS (
> SELECT RDB$FIELD_SOURCE FROM RDB$RELATION_FIELDS R
> WHERE R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME )
>
> and all the unused domains were gone afterwards.
>
> But I don't guarantee for any side-effects.
>
>
> Regards
> Luic.-
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/>.