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

Moderator: admin

Post Reply
ETS User

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

Post 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.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests