• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding duplicate objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding duplicate objects


  • Subject: Re: Finding duplicate objects
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 28 Sep 2009 11:38:43 -0700

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


  • Follow-Ups:
    • Re: Finding duplicate objects
      • From: Don Lindsay <email@hidden>
References: 
 >Finding duplicate objects (From: Jeff Dunnett <email@hidden>)

  • Prev by Date: Re: Backtrack and re-submit WOSubmitButton behaviour
  • Next by Date: RE: D2W Edit Lists as shown in WOWODC 09 talk
  • Previous by thread: Finding duplicate objects
  • Next by thread: Re: Finding duplicate objects
  • Index(es):
    • Date
    • Thread