Subject Re: [firebird-support] Change Domain Name
Author Helen Borrie
At 08:58 PM 7/10/2003 -0300, you wrote:
>Hi,
>
>This message can be a repost, but I am doing it because I don't get showing
>in my Outlook Explorer.
>
>
>I have a domain called 'BOOLEAN' and I'd like to change your name
>to'D_BOOLEAN'.
>
>1. I have tried the next:
>
>--->ALTER DOMAIN BOOLEAN TO D_BOOLEAN;
>But, this give me an error saying:
>ISC ERROR CODE:335544351
>ISC ERROR MESSAGE:
>unsuccessful metadata update
>MODIFY RDB$FIELDS failed
>action cancelled by trigger (1) to preserve data integrity
>Cannot update index segment used by an Integrity Constraint
>
>2. I also try it:
>I create a domain called D_BOOLEAN similar to BOOLEAN changing only your
>name.
>--->alter table agenda alter atend to D_BOOLEAN
>but I get an error:
>
>ISC ERROR CODE:335544351
>ISC ERROR MESSAGE:
>unsuccessful metadata update
>Column ATEND from table AGENDA is referenced in AD_AGENDA

Try removing the foreign key constraint and changing AD_AGENDA first.


>I have many columns in several tables of the type BOOLEAN.
>
>I didn't like to create a new DB and pump the data.
>
>Is there a easy way to do it?

It depends what you call "easy". Referential integrity protects
references. That creates dependencies. So start at the bottom of the
dependency chain. You can put the dependencies back once you have changed
the domain name everywhere.

And use this as a learning experience for next time you have to design
names for your database objects. :-)

h.