db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain RICHET <derb...@gmail.com>
Subject Re: Using/Adressing a "row number" in a SELECT query
Date Fri, 17 Feb 2006 13:41:46 GMT
OK Bernt, thanks.

I have already tested these methods.
Maybe anything to add about the lack of "row number" pointer at SQL level ?
...



On 2/17/06, Bernt M. Johnsen <Bernt.Johnsen@sun.com> wrote:
>
> >>>>>>>>>>>> Sylvain RICHET wrote (2006-02-17 11:55:37):
> > Thanks Legolas,
> >
> > ... but limiting the fetch size by JDBC API supported methods
> (setFetchSize)
> > implies that i have already loaded ALL records from database, no ?
>
> setFetchSize is an optimization hint to the driver/database and will
> not affect the result.
>
> setMaxRows will limit the number of rows in the resulting
> resultset. And any decent JDBC-driver will limit the number of rows
> "loaded" from the database (in client/server mode, that is).
>
> >
> > However, the datas persisted in my DERBY database concern logging. It
> means
> > that i would have to get thousands of records.
> >
> > On 2/17/06, Legolas Woodland <legolas.w@gmail.com> wrote:
> > >
> > > Sylvain RICHET wrote:
> > >
> > > Hi everyone,
> > >
> > > In a selection statement, i would like to get blocks of records.
> > > Thus, i need to filter records by a "row number", directly at the
> SELECT
> > > level.
> > >
> > > It seems that the way to address a row number is not (SQL) standard.
> > > (different "proprietary" implementations)
> > >
> > > In Oracle, there is the "rowid".
> > > In MySQL, the "LIMIT" clause can do it.
> > > In SQL Server, i think there is the "ROW_NUMBER() OVER..."
> > > In DB2 (on AS/400) , there is the "RRN" (Relative Record Number)...
> > >
> > > What about Derby database ?
> > > How is it implemented on this server ?
> > >
> > > I know i could use
> > >
> > > Thanks in advance.
> > >
> > > Derby sql does not has any facilities for limiting number of rows in
> > > select statement.
> > > you can just limit the fetch size in JDBC resultSets.
> > >
> > >
>
> --
> Bernt Marius Johnsen, Database Technology Group,
> Staff Engineer, Technical Lead Derby/Java DB
> Sun Microsystems, Trondheim, Norway
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
>
> iD8DBQFD9c7IlFBD9TXBAPARAvSNAKC1tC9EW6HP+9VXPzivCuy8Zxg4iwCffubD
> 2n2X6L/xi6B+beWfnVYMCQQ=
> =tYlq
> -----END PGP SIGNATURE-----
>
>
>

Mime
View raw message