Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Nulls & Order By

Re: Nulls & Order By

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Wed, 05 Mar 2003 08:26:51 -0800
Message-ID: <3E66254B.3D1DC217@exesolutions.com>


Joy Hsu wrote:

> Hi,
>
> I'm using java.sql.DatabaseMetaData.nullsAreSortedHigh() to check if
> the nulls are sorted as the highest values, but the method seems to
> return the wrong value : false. It should be true since Oracle has
> NULLS LAST as the default for ascending order. The SQL I have is like
> 'Select field FROM table ORDER BY 1' and the null values are at the
> end of the returned resultset. Anyone has experience using this method
> or knows why I got the wrong value? or is there some other way to get
> this info?
>
> I don't want to use NULLS FIRST/LAST because we have different
> databases to support. It would be easier if I can get this info in
> database metadata.
>
> Thanks,
> Joy

I understand the huge pressure when working against multiple back-end implementations to write generic code. And it may be possible to do it here. But inspite of that pressure I would urge you, and your team, to not do this with Oracle unless you have little concern for performance, scalability, and data integrity.

Daniel Morgan Received on Wed Mar 05 2003 - 10:26:51 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US