Page 1 of 1

About Question enthuware.oce-jpad.v6.2.466 :

Posted: Sun Mar 18, 2012 9:09 am
by ETS User
I doubt the code in question will work. Reason: in most cases foreign key constraint violation will not allow to delete ACCOUNT table row if ADDRESS row refers to it.

Developer needs set DDL for foreigh key on ADDRESS as:

Code: Select all

ON DELETE SET NULL
Another option (without DDL hacks) set Address proeprty to NULL on Account (this will set NULL to ADDRESS table FK), and then delete Account.

Re: About Question enthuware.oce-jpad.v6.2.466 :

Posted: Mon Mar 19, 2012 6:42 am
by admin
You are right but the question doesn't say that there is a foreign key constraint created in the database (although logically I agree that there is.) But there is a possibility that tables are not created by the persistent provider (legacy tables) and there is no FK constraint.

So I think for the purpose of the question, it is ok.

HTH,
Paul.