db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Mueller <padd...@gmx.net>
Subject Re: delete-connection SET NULL: two columns in one table referencing same column
Date Wed, 10 Feb 2010 14:37:55 GMT
noone? :(

Am 02.02.2010 17:08, schrieb Patrick Mueller:
> Hi derby users!
>
> In my database I want two columns referencing as FK to the same column 
> in another table(see below) using the delete connection SET NULL but 
> it just won't work.
>
> ALTER TABLE HM_DESK ADD CONSTRAINT DESK_OWNER_FK FOREIGN KEY 
> (IDF_OWNER) REFERENCES HM_USER (ID_USER) ON DELETE SET NULL;
> ALTER TABLE HM_DESK ADD CONSTRAINT DESK_LASTEDITEDBY_FK FOREIGN KEY 
> (IDF_LASTEDITEDBY) REFERENCES HM_USER (ID_USER) ON DELETE SET NULL;
>
> --> results in a error when executing the second statement:
>
> "Error: Foreign  Key 'DESK_LASTEDITEDBY_FK' is invalid because 'The 
> table cannot be defined as a dependent of table APP.HM_USER because of 
> delete rule restrictions. (The relationship causes the table to be 
> delete-connected to the indicated table through multiple relationships 
> and the delete rule of the existing relationship is SET NULL.).  '.
> SQLState:  42915
> ErrorCode: 30000"
>
> if I am using 'ON DELETE CASCADE'  it works perfectly fine.. what's 
> wrong?
>
>
> Thanks in advance!
>
> Patrick M.
>
>
>
>
>

Mime
View raw message