Can I insert null values in Foreign Key constraint.?
Kindly suggest here, Thanks in advance.
Yes. Foreign key can take Null . e.g in Emoloyee table we have employee_id and manager_id where manager_id is foregin key and CEO of the organization doesn't have manager so his manager_id will be NULL in Employee table.
One more thing.. Foreign key may reference Primary key and Unique key as well and Unique key can have NULL value so foreign key can have..
Yes we can.
There is clause on delete set null used to delete parent record without deleting child record at that time foreign key value update as null.
And directly insert null for foreign key.
Sign up for STechies
Ask Question From Our Experts
All the site contents are Copyright © www.stechies.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies. The site www.stechies.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity. Information used on this site is at your own risk.
The content on this site may not be reproduced or redistributed without the express written permission of
www.stechies.com or the content authors.