Subject Re: [firebird-support] "select first" will not work in a VIEW..
Author Helen Borrie
At 09:46 PM 11/04/2005 +0000, you wrote:

>This statement will not work for a VIEW:
>
>select first 10 start_price, title, BEECOM_ITEM_ID from vendor_item
>order by beecom_item_id DESCENDING;
>
>
>Here is the error:
>
>Invalid token.
>Dynamic SQL Error.
>SQL error code = -104.
>Token unknown - line 5, char 8.
>first.

Correct. SELECT FIRST operates on an ordered output set. You cannot
create ordered sets using views.

What you need to do is define your view to encompass the set and then
define the restricted set by placing the SELECT FIRST and the ORDER BY in
the request statement, i.e.

select first 10 <fieldlist> from aView
order by beecom_item_id DESCENDING;

However, for your example, it's entirely unnecessary to put a view behind
this set, since it can be got directly using your SELECT statement.

./heLen