Subject Re: [ib-support] Changing field all places
Author Paul Vinkenoog
Hi Michael,

> I have a table (MyTable) with a primary key.
> This primary key is of type varchar(30) not null.
> Now one of our customers want to change this.
> My problem is, that it is linked to other tables.
> Can I do smething, to change to condition of this field, so that
> upon change the DB will change it in all places where it is being
> reference as a foreign key ?

Yes, when you define a foreign key you can add: ON UPDATE CASCADE

I don't think you can change this behaviour for an existing FK though.
You'd have to first drop the FK and then recreate it with ON UPDATE
CASCADE added.

BTW - People who know much more about database design than I do always
tell me:

a) never use a PK which has "business meaning"; use a generated PK;
b) never ever let your end users touch the PK of any table.

Paul Vinkenoog