Subject RE: [IBO] SQLWhereItems help...
Author Svein Erling Tysvær
Hi Paul!

Firebird first implemented FIRST ... SKIP ..., then the SQL standard included ROWS..., and then Firebird allowed ROWS to comply with the SQL standard (if I remember correctly). I think ROWS have been available since Firebird 2.0.

Like you, I do not use ROWS myself, that's mainly because I work with Firebird 1.5. Though I would expect

select id, name, address
from customer
order by id
rows 100 to 200

to be equivalent to

select first 101 skip 99 id, name, address
from customer
order by id

It seems like whatever version of IBO Iwan is using, ROWS are put in front of ORDER BY. I do not know if this is due to the IBO version, how Iwan do things (I don't think ROWS is part of the WHERE clause, so I kind of doubt that SQLWhereItems is the right place to add ROWS) or an error in IBO. I expect changing to FIRST...SKIP could be a quick solution, but being that ROWS is the standard, it would be better if someone could tell Iwan how to make this work with IBO.

Set

-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf Of Paul Hope
Sent: 28. mai 2008 11:20
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] SQLWhereItems help...

Hi Iwan

'rows 100 to 200' is not syntax that I have seen before.
Do you mean
Select first 100 skip 100 id, name, address
from customer
rows 100 to 200
order by id ?

Regards
Paul

> -----Original Message-----
> From: IBObjects@yahoogroups.com
> [mailto:IBObjects@yahoogroups.com] On Behalf Of send2iwan
> Sent: 28 May 2008 09:47
> To: IBObjects@yahoogroups.com
> Subject: [IBO] SQLWhereItems help...
>
> Dear all,
>
> i am using SQLWhereItems everything ok, until change my query
> like this select id, name, address from customer rows 100 to
> 200 -> add this line
>
> after check with monitor query became
> select id, name, address
> from customer
> rows 100 to 200
> order by id -> this make error
>
> how to solve this one?
>
> please some hints.
>
> thanks.
> Iwan