Subject Re: [ib-support] Unwanted Domains
Author Claudio Valderrama C.
I'm not a frequent contributor of this list. I seldom read the headers to
find something interesting. This thread caught my attention. I hope I didn't
come too late. Otherwise, my apologies.

Now, shouting:

DON'T USE THE STATEMENT SHOWN BELOW!
RDB$RELATION_FIELDS IS ONLY ONE OF THE TWO TABLES THAT LOOKUP DOMAINS
(EITHER EXPLICIT OR IMPLICIT DOMAINS) IN RDB$FIELDS. THE OTHER IS:
RDB$PROCEDURE_PARAMETERS => IT ALWAYS LEADS TO IMPLICIT DOMAINS, IE
RDB$<NUMBER>.

IF YOU HAVE ARRAY-BASED DOMAINS OR FIELDS DEFINED DIRECTLY, YOU WILL LEAVE
DANGLING ENTRIES IN RDB$FIELD_DIMENSIONS, TOO. DEPENDING ON YOUR METADATA,
YOU MAY HAVE SPOILED RDB$DEPENDENCIES "AS A PLUS".

ALSO, WITH THIS COMMAND, YOU DESTROYED EVERY EXPLICIT DOMAIN (CREATE DOMAIN
name) THAT YOU MAY HAVE DEFINED IN ADVANCE AND THAT YOU STILL DON'T USE.
WORSE, FOR SOME WEIRD REASON, YOU COULD WIPE OUT A SYSTEM DOMAIN, SO ALWAYS
CHECK FOR
RDB$SYSTEM_FLAG... BEING PARANOID MAY BE A GOOD SUGGESTION HERE.

Maybe I should implement a command like
DROP UNUSED DOMAINS
in firebird...

Anyway, Todd, after deleting things from system tables directly through DML
and before doing DDL like "alter table", I recommend a hard commit.

I think stored procedures didn't exist in the engine when Ann lost contact
with source code for several years circa 1991.
Keep crying. :-)

C. (still somewhat astonished with this thread)
---------
Claudio Valderrama C.
Ingeniero en Informática - Consultor independiente
http://www.cvalde.com - http://firebird.sf.net


""Ann W. Harrison"" <aharrison@...> wrote in message
news:<5.1.0.14.2.20010712174231.01bd4aa0@...>...
> At 09:29 PM 7/12/2001 +0000, Todd Brasseur wrote:
> >Is there a quick way of getting rid of all domains in a database that
> >aren't used by anything?
>
> delete from rdb$fields f where not exists
> (select 1 from rdb$relation_fields rfr
> where rfr.rdb$field_source = f.rdb$field_name);
>
> Regards,
>
> Ann
> www.ibphoenix.com
> We have answers
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>