db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tiago Espinha <ti...@espinhas.net>
Subject Re: Question about FETCH FIRST
Date Mon, 27 Apr 2009 21:19:27 GMT
Hi Dag,
Thank you for your input. :)

I think it's perfect as it is then. If the standard is clear and strict like
that, then I'm all for keeping it the way it is.

Tiago

On Mon, Apr 27, 2009 at 9:51 PM, Dag H. Wanvik <Dag.Wanvik@sun.com> wrote:

>
> Hi Tiago,
>
> thanks for testing this new feature!
>
> Tiago Espinha <tiago@espinhas.net> writes:
>
> > The question is about the following SQL statement:
> >   select * from t1 fetch first 0 rows only;
>
> According to the latest SQL standard draft that I've been able to see,
> this should give an error, cf. section 7.13 (quote):
>
> 7.13 <query expression>
>
> General Rules
> :
> 8) If <fetch first clause> is specified, then:
>   a) Let OCT2 be the cardinality of T.
>
>      NOTE 212 - OCT2 is the cardinality of T after the removal of any
>      rows from T by the application of the prior General Rule.
>   b) Case:
>
>       i) If <fetch first row count> is specified, then let FFRC be
>       the value of <fetch first row count>.
>
>       ii)     Otherwise, let FFRC be 1 (one).
>
>   c) If FFRC is less than 1 (one), then an exception condition is
>       raised: data exception - invalid row count in fetch first
>       clause.
>
> I would have liked the semantics you suggest, but for prudence I think
> we should stick with the standard for now. We could always be more
> liberal later, it is harder to remove something people already rely
> on.
>
> Dag
>

Mime
View raw message