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

From: Chuck Simpson (chuckls_at_cox-internet.com)
Date: 06/12/04

  • Next message: Joe Weinstein: "Re: PreparedStatement"
    Date: Sat, 12 Jun 2004 13:26:09 -0500
    
    

    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


  • Next message: Joe Weinstein: "Re: PreparedStatement"

    Relevant Pages

    • Re: JDBC: what exactly does nullsAreSortedHigh() return?
      ... are nulls considered as the highest ... > - Oracle returns false. ... Nulls are last when sorted in ascending order. ... This is the interpretation that FirstSQL/J uses. ...
      (comp.lang.java.databases)
    • Re: JDBC: what exactly does nullsAreSortedHigh() return?
      ... are nulls considered as the highest ... Nulls are last when sorted in ascending order. ... public boolean nullsAreSortedHigh() ... NULL values are sorted at the end regardless of sort order. ...
      (comp.lang.java.databases)
    • JDBC: what exactly does nullsAreSortedHigh() return?
      ... are nulls considered as the highest ... Nulls are last when sorted in ascending order. ... Now, behavior of Oracle and Postgres is same in terms of sort order, ...
      (comp.lang.java.databases)
    • Re: Sort on Multiple Fields, Nulls at End
      ... Sort ascending on this field along with whichever other fields you're ... a Closed field and some have not been processed so they have no dates ... ascending order, then Referred in ascending order, then Closed in ... then the Nulls at the end. ...
      (microsoft.public.access.queries)
    • Re: Indexes and -Null- values
      ... > I've encountered this problem running Oracle 9i. ... > same issues with nulls exist outside of the Oracle product... ... > Database Designers tend to try to minimize the use of NULLABLE columns ...
      (comp.databases)