Re: Finding duplicate objects
Re: Finding duplicate objects
- Subject: Re: Finding duplicate objects
- From: Jeff Dunnett <email@hidden>
- Date: Tue, 29 Sep 2009 08:58:46 -0400 (EDT)
Sybase ASA 9
Regards,
Jeff
On Mon, 28 Sep 2009, Don Lindsay wrote:
Hello;
What database are you using? Oracle, MySql, etc.
Don
On Sep 28, 2009, at 2:38 PM, Chuck Hill wrote:
Hi Jeff,
On Sep 28, 2009, at 10:09 AM, Jeff Dunnett wrote:
Hello,
I am having trouble creating a fetch specification selects duplicate
objects but bases the comparison on only a few select fields. For instance
a fetch specification that mimics the follow SQL query:
SELECT school_number, first_name, last_name
FROM "cms"."ms_contestant"
WHERE (contest_id = 0x000081618cb5000007d202000000011f85e471540a2b2f43
OR contest_id = 0x000081618cb5000007d204000000011f85e471540a2b2f43
OR contest_id = 0x000081618cb5000007d206000000011f85e471540a2b2f43)
GROUP BY school_number, first_name, last_name
HAVING COUNT(*) > 1
Is there a way to do this?
You are not fetching EOs, so EOF is not going to directly do this.
Wonder's ERXSQLHelper has some code to help you make the GROUP BY and
HAVING clauses. I am not aware of any other support in Wonder for this. I
think you would end up using EOF and ERXSQLHelper to fetch raw rows.
You might be better off doing this in memory, fetching the data for one
school at a time. Or, better still, create a named unique constraint in
the database to prevent this from happening in the first place.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden