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

Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC: what exactly does nullsAreSortedHigh() return?

Re: JDBC: what exactly does nullsAreSortedHigh() return?

From: Chuck Simpson <chuckls_at_cox-internet.com>
Date: Sat, 12 Jun 2004 13:26:09 -0500
Message-ID: <pan.2004.06.12.18.26.01.708462@cox-internet.com>


On Wed, 02 Jun 2004 23:25:50 -0700, Vikas Rana wrote:

> Hi all,
>
> I am a bit confused about the method
> java.sql.DatabaseMetaData.nullsAreSortedHigh(). What exactly does this
> return? If this returns true, are nulls considered as the highest value?
> Or does this mean that nulls comes first when sorted in ascending order
> (opposite in meaning to the first).
>
> Consider this.
>
> - Oracle returns false. Nulls are last when sorted in ascending order.
>
> - MSSQL2K returns true. Nulls are first when sorted in ascending order.
>
> - Postgres returns true. Nulls are last when sorted in ascending order.
>
> Now, behavior of Oracle and Postgres is same in terms of sort order, but
> they return different values.
>
> Who is right?

It depends on whether Oracle is returning true or false from nullsAreSortedAtEnd. If this method returns truw then it does not matter what is returned by nullsAreSortedHigh. Nulls will always be last no matter what sort order you choose.

Chuck Received on Sat Jun 12 2004 - 13:26:09 CDT

Original text of this message

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