This is a discussion on How can I avoid Dependent foreign key constraint within the Sybase forums, part of the Database Server Software category; --> Hello, I am really new to Sybase I have the following problem: Dependent foreign key constraint violation in a ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, I am really new to Sybase I have the following problem: Dependent foreign key constraint violation in a referential integrity constraint. dbname = 'naturideen', table name = 'products', constraint name = 'fk_sub_products_ref_sub'. (number=547 severity=16 state=1) Could somebody explain me how to solve it or show me the soloution in the manual? Greetings Manuel -- Interactive ID - Manuel Blechschmidt Crailsheimerstr. 10 12247 Berlin Tel: 030/77208574 Mobil:0179/4644688 |
| |||
| Hi Manuel, Presumably you have got the following situation: 1. table products (col1_foreign), where col1_foreign has got a foreign key constraint refering to products (col1_prim). 2. table prod_prim(col1_prim) Then you need to make sure, that you insert into products(col1_foreign) only values which are already in prod_prim (col1_prim). With sp_helpconstraint "tablename" you can see the constraints on this table. Hope that helps. Regards, Ulrike "Manuel Blechschmidt" <Manuel.Blechschmidt@gmx.de> wrote in message news:<bogs5i$k2b$05$1@news.t-online.com>... > Hello, > I am really new to Sybase I have the following problem: > Dependent foreign key constraint violation in a referential integrity > constraint. dbname = 'naturideen', table name = 'products', constraint name > = 'fk_sub_products_ref_sub'. (number=547 severity=16 state=1) > Could somebody explain me how to solve it or show me the soloution in the > manual? > Greetings > Manuel |
| |||
| Hi Manuel, I think I misunderstood your message. If you update/delete the primary key on a table and you would like to do the same with the foreign keys, you could use a trigger. Regards, Ulrike "Manuel Blechschmidt" <Manuel.Blechschmidt@gmx.de> wrote in message news:<bogs5i$k2b$05$1@news.t-online.com>... > Hello, > I am really new to Sybase I have the following problem: > Dependent foreign key constraint violation in a referential integrity > constraint. dbname = 'naturideen', table name = 'products', constraint name > = 'fk_sub_products_ref_sub'. (number=547 severity=16 state=1) > Could somebody explain me how to solve it or show me the soloution in the > manual? > Greetings > Manuel |
| ||||
| "Ulrike Zintz" <zintz@arcor.de> schrieb im Newsbeitrag news:539a5d55.0311100418.2eb2b908@posting.google.c om... > Hi Manuel, > > I think I misunderstood your message. > > If you update/delete the primary key on a table and you would like to > do the same with the foreign keys, you could use a trigger. Thanks for the answer. I will insert a new record with the updatet values with insert into products values select 'newnr', att1, att2 from products whrer nr = 'oldnr'. The Trigger would be a better solution, but i dont want to edit the the structure of the System. Greetings Manuel > Regards, > Ulrike > > > "Manuel Blechschmidt" <Manuel.Blechschmidt@gmx.de> wrote in message news:<bogs5i$k2b$05$1@news.t-online.com>... > > Hello, > > I am really new to Sybase I have the following problem: > > Dependent foreign key constraint violation in a referential integrity > > constraint. dbname = 'naturideen', table name = 'products', constraint name > > = 'fk_sub_products_ref_sub'. (number=547 severity=16 state=1) > > Could somebody explain me how to solve it or show me the soloution in the > > manual? > > Greetings > > Manuel |