• 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
ERXBatchingDisplayGroup, Oracle and Sorting Null Values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERXBatchingDisplayGroup, Oracle and Sorting Null Values


  • Subject: ERXBatchingDisplayGroup, Oracle and Sorting Null Values
  • From: David Avendasora <email@hidden>
  • Date: Fri, 8 Jan 2010 10:20:54 -0500

Hi all,

This has taken me a while to track down, and I just want to make sure I've figured it out correctly, and if so, what the possible solutions are.

Oracle sorts null values to the end, so ORDER BY FIRST_NAME returns:

Anjo
Chunk
Mike
Null

EOSortOrdering sorts null values to the begining, so NAME.ascs() returns:
Null
Anjo
Chunk
Mike

Which does some really crazy things to ERXBatchingDisplayGroup. 

Let's say I have 100 rows in the DG. All the Name attributes are null, except for those three.

First the DB selects all the records and sorts them with nulls last, then gets the first 10 ids :

select * from (select NAME, rownum eo_rownum from (SELECT t0.NAME FROM PEOPLE t0 ORDER BY t0.NAME ASC)) where eo_rownum between 1 and 10 

The results will be: Anjo, Chunk, Mike, null, null, null, null, null, null, null.

Then EOF sorts the array again, so the DG displays: null, null, null, null, null, null, null, Anjo, Chunk, Mike and all the subsequent batches will be full of nulls.

If this interpretation is correct, am I the first to run into this with Oracle?

I've been digging through the EROraclePlugin, and I figured adding this to the EROracleExpression class would fix it, but it doesn't:

    @Override
    protected void appendItemToOrderByString(String sqlString) {
        appendItemToListString(sqlString + " NULLS FIRST",
                               _orderByString());
    }

Anyone have any other suggestions?

Thanks,

Dave
 _______________________________________________
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: ERXBatchingDisplayGroup, Oracle and Sorting Null Values
      • From: Mike Schrag <email@hidden>
  • Prev by Date: Re: Best way to run period task?
  • Next by Date: Re: FrontBase 5
  • Previous by thread: WOWebServiceClient throwing confusing error on constructor
  • Next by thread: Re: ERXBatchingDisplayGroup, Oracle and Sorting Null Values
  • Index(es):
    • Date
    • Thread