Subject Re: [firebird-support] Read-Only View
Author Ann Harrison
Helen,

> At 10:15 PM 22/03/2011, gorepj wrote:
>>I have created a view which is unexpectedly read-only. ...
>>
>>If I remove the ORDER BY Clause it becomes updatable.  I can't see in the documentation that having an ORDER BY clause will make a view read-only.
>
> I don't know why it would be updatable, as an ordered set is not a natural set.
>
> ORDER BY in a view is quite a recent addition, too.  I wondered if it was an accident! There doesn't seem to be much use for it.


In the bad old days, the SQL Standard opined that ORDER BY was not
part of a query expression, so it could not be used in a subquery or a
view definition. The current standard include ORDER BY in query expressions,
and thus in subqueries and views. Perhaps the thinking was that you couldn't
use FIRST/LIMIT reliably in views or subqueries without ordering the set first.


Cheers,

Ann