sql - Error Code: 1452. Cannot add or update a child row: -
sql - Error Code: 1452. Cannot add or update a child row: -
a foreign key constraint fails (ldatabase
.book
, constraint bpid
foreign key (bpid
) references publish
(pid
) on delete no action on update no action) insert ldatabase
.book
(bid
, title
, author
, bpid
, available
, language
) values (20, 'dsp', 'kevin', 01, 10, 'eng')
i have created tables , inserted values publish table.. when trying come in values book table .. due misfortune have encountered error
posted error indicates that, column bpid
in table ldatabase.book
has foreign key relationship publish
table pid
column.
which means, before insert bpid
key in book
table create sure same key (pid
) exists in publish
table else end above posted error.
sql
Comments
Post a Comment