Subject | Re: [ib-support] Altering FK constraint via script |
---|---|
Author | Claudio Valderrama C. |
Post date | 2002-02-26T06:45:15Z |
""sdbeames"" <s.beames@...> wrote in message
news:a5e776+103cs@......
one connection to the db.
the field at the end.
C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing
news:a5e776+103cs@......
> Hi all,A bit old. We had 0.95, 0.96 (lasted few time), RC1 & RC2.
>
> FB 0.9.4.41/IB_SQL
> can I alter a foreign key's constraints within a single script?=> COMMIT HERE, you are mixing DDL with DML. It may work when you have only
> It seems I have to disconnect & reconnect before dropping the
> constraint, but 'disconnect all' isn't allowed. SYSDBA is sole user.
> The following causes an 'object INDEX is in use' error at the 'drop
> constraint' statement.
> /****************************************/
> alter TABLE ITEMSUSED add TEMP INTEGER;
> commit;
> update ITEMSUSED set TEMP = ITEMNO;
one connection to the db.
> /* have to dis/reconnect here */COMMIT again.
> alter table ITEMSUSED drop constraint ITEMS_ITEMNO_FK;
> commit;
>
> alter table ITEMSUSED add constraint ITEMS_ITEMNO_FK
> FOREIGN KEY (ITEMNO) REFERENCES ITEMS
> ON UPDATE CASCADE
> ON DELETE SET NULL;
> commit;
> update ITEMSUSED set ITEMNO = TEMP;
> alter table ITEMSUSED drop TEMP;I assume this is only an example. I wouldn't go to those pains just to drop
> commit;
the field at the end.
C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing