We have One to Many DB2 table with Auto Increment as Default. Both Primary key o

We have One to Many DB2 table with Auto Increment as Default. Both Primary key of Parent and Foreign Key of Child has been defied as Not Null in the DB2 table. We are getting SQL code 503 i.e. constraint violation when we insert data with Primary Key and Foreign Key as Null.
We have 2 below solution to fix this. Please let us know which is the right one as we need to take this approach to DBA.
-> Change the foreign key of Child table as Null from Not Null in DB2 table.
--> Change the Child table Auto Increment as Always from Table.

OriginalPostID-145648

OriginalPostID-145648

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data