dbTalk Databases Forums  

How can I avoid Dependent foreign key constraint

comp.databases.sybase comp.databases.sybase


Discuss How can I avoid Dependent foreign key constraint in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Manuel Blechschmidt
 
Posts: n/a

Default How can I avoid Dependent foreign key constraint - 11-07-2003 , 01:35 PM






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



Reply With Quote
  #2  
Old   
Ulrike Zintz
 
Posts: n/a

Default Re: How can I avoid Dependent foreign key constraint - 11-10-2003 , 04:58 AM






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 (AT) gmx (DOT) de> wrote

Quote:
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

Reply With Quote
  #3  
Old   
Ulrike Zintz
 
Posts: n/a

Default Re: How can I avoid Dependent foreign key constraint - 11-10-2003 , 06:18 AM



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 (AT) gmx (DOT) de> wrote

Quote:
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

Reply With Quote
  #4  
Old   
Manuel Blechschmidt
 
Posts: n/a

Default Re: How can I avoid Dependent foreign key constraint - 11-16-2003 , 06:12 AM




"Ulrike Zintz" <zintz (AT) arcor (DOT) de> schrieb im Newsbeitrag
news:539a5d55.0311100418.2eb2b908 (AT) posting (DOT) google.com...
Quote:
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

Quote:
Regards,
Ulrike


"Manuel Blechschmidt" <Manuel.Blechschmidt (AT) gmx (DOT) de> wrote

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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.