Hi, I am relatively new to writing SQL so I apologise if this is something I should know. I have the following statement;
My code seems to do as I expected, but I get the following error appear;
My first questions is what is proditem001? It doesn't exist in our system. Also what is the error in my code? asked 25 May '16, 12:04 Jongee |
There is nothing wrong with your code, it is your data that is not satisfying the schema of your database. You have not shown your schema but from the error message I can infer that there is a foreign key (named "proditem001") from table proditemlinks to some other table (which I cannot determine from the information that you have given), and the other table does not contain a row with a primary key value is equal to one of the rows that you are trying to insert. The 'proditem001' is the name of the foreign key in table proditemlinks. HTH answered 25 May '16, 12:16 Mark Culp Thanks Mark, I have just found the hidden 'proditem001' when looking to give you my schema.
(26 May '16, 03:44)
Jongee
|
Here is a SQL example to accompany Mark's answer...