Unix C++
Would you like to react to this message? Create an account in a few clicks or log in to continue.

to update using cascade

3 posters

Go down

to update using cascade Empty to update using cascade

Post by aarthi Thu Mar 18, 2010 2:22 pm

I created customer table with cust_id as primary key...and
then created a department table and used cust_id as its foreign key...
I tried updating the cust_id in the customer table bt got an error 'violations..child found'.
how to update cust_id in both the tables using CASCADE?

aarthi

Posts : 12
Points : 22
Join date : 2010-02-26

Back to top Go down

to update using cascade Empty Re: to update using cascade

Post by DineshThangaraju Thu Mar 18, 2010 3:25 pm

@ aarthi,

How did u check whether cust_id is set as foreign key in department table ?

DineshThangaraju

Posts : 18
Points : 19
Join date : 2010-02-26
Age : 35
Location : India

Back to top Go down

to update using cascade Empty Re: to update using cascade

Post by aarthi Thu Mar 18, 2010 3:33 pm

I am not able to enter value for cust_id for department table that is not in customer table.
it says integrity constraint violated parent-key not found!!!

aarthi

Posts : 12
Points : 22
Join date : 2010-02-26

Back to top Go down

to update using cascade Empty Re: to update using cascade

Post by Mahee Tue Mar 23, 2010 2:31 pm

I think
using cascade you can delete all the record in dept table if the related row in cust table id deleted.. As for Update, You can update all the data except the related column(custid).
No point in using cascade to update the foriegn key by itself.
Mahee
Mahee

Posts : 29
Points : 233
Join date : 2010-03-03
Location : Haldia

Back to top Go down

to update using cascade Empty Re: to update using cascade

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum