2

I have 3 tables

Table 1: PlantName (primary key)
Table 2: (primary key(Id + PlantName)), foreign key(PlantName) references Table1(PlantName)
Table 3: (primary key(Id + PlantName)), foreign key(id) references Table2(id)
When I insert data into these tables
Table1: Ark1
Ark2
Ark3
Table 2:
1,Ark1
2,Ark1
3, Ark1
1, Ark2
2, Ark2
1, B1
2, B2
Table 3:
1,Ark1
2,Ark2

At this insertion in Table3 it has a problem with Foreign key.

Please suggest

Thank you

Sun

asked May 3, 2012 at 17:24

1 Answer 1

1

B1 and B2 do not exist in table 1, which causes the foreign key violation.

answered May 3, 2012 at 17:28
Sign up to request clarification or add additional context in comments.

1 Comment

sorry, please see the edit. Fkey violation is caused during insertion for Table 3.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.