Updating tables with foreign key constraints
When trying to delete a Customer which already has some orders created for it, HANA will cascade the deletion statement to the referencing orders, i.e., it will delete the customer and all orders of that customer.In this case, Order #2, which referred Customer #2, was deleted from the “ORDER” table.
Running the same test as above, we finally get the expected entries in the Order table, hence proving the failed loading was indeed due to the FK.
Next, I altered the referential action of the FK to “CASCADE”, in order to evaluate its behvaior.
Actually, I dropped the original FK and created an additional one.
If you haven’t defined a proper name for the FK (e.g.
during CREATE TABLE statement), HANA will define an internal name, which can be found in this table, under the “CONSTRAINT_NAME” column.