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 |