Unix Technical Forum

How can I avoid Dependent foreign key constraint

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 ...


Go Back   Unix Technical Forum > Database Server Software > Sybase

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 03:04 PM
Manuel Blechschmidt
 
Posts: n/a
Default How can I avoid Dependent foreign key constraint

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 03:04 PM
Ulrike Zintz
 
Posts: n/a
Default Re: How can I avoid Dependent foreign key constraint

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 03:04 PM
Ulrike Zintz
 
Posts: n/a
Default Re: How can I avoid Dependent foreign key constraint

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 03:05 PM
Manuel Blechschmidt
 
Posts: n/a
Default Re: How can I avoid Dependent foreign key constraint


"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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:27 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com