Stefan Evans wrote:From your error message, the constraint that is failing is: V07PATTR.KONTOÄGARE_KNR_FK
That points to being the Table: Kontoagare, knr column which references konto.knr
I presume this error comes when running an insert into kontoagare?
thanks for replying. Yes it is
Looking at your insert statements, you do appear to have created parent records appropriately.
For instance the knr value of 123 in the above statement was inserted:
Is it actually there?
If you select * from konto where knr=123, do you get that record back?
No its not..thats the problem. Nothing gets inserted and i just get that error message which i find very odd
The other foreign key reference is the pnr field which references the Bankkund table.
You haven't shown any statements to populate the Bankkund table. Does the value '540126-1111' appear in that table?
there are no values added in the table whatsoever..thats why i am sooo confused. No values and primary key error.... ive been googling for days and went through my tables at least 50 times... cannot figure out the problem
Stefan Evans wrote:Ok, so to insert a value into the kontoagare table, you need an entry in the konto table first.
That is not there, and thus explains the error message you posted.
Why is that value not there?
Presumably trying to insert the record into the konto gives you a similar message, complaining about the ktrn column?
so taking a further step back, are there any records in the kontotyp table?
If not, what happens when you execute just THAT insert statement?
My suggestion:
Execute those statements you have listed one by one. The first time you get an error message, stop and fix that one, because none of the others after it will work.
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|