Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insert null in columm which have FOREIGN KEY constraint

843830Apr 27 2005
I have a 2 table. table structure is like this:
table A
(pkidA, name,address)
table B
(pkidB, fkA, year)
in table A pkidA is a primary key
in table B pkidB is a primary key. and fkA is a foreign key with pkidA of table A.
in table B value of fkA is can be null.

i created cmp for table A and table B.



i want to insert one row in table B like (112,,2005) means i want to add fkA null value.
when i create a row it gives this error:
java.sql.SQLException: INSERT statement conflicted with COLUMN FOREIGN KEY constraint

thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2005
Added on Apr 27 2005
0 comments
245 views