On Wed, 18 Jul 2001 11:03:11 -0700, Dan Goldberg wrote:

>I can not edit data in a view in the windows version of R:base but I 
could in the DOS version. I pressed [F4] and I am in data editor but I 
still can not edit anything. 

Dan,

I just did a test, and was able to edit and update a table through a 
simple view of that table from the RBWin browser/editor.

In either the DOS or Windows version, it is very easy to make a view 
"non-updatable."   For example, if you "sort" a view, either by putting 
an ORDER BY clause in the definition, or by sorting the browser 
window, it is no longer updatable.  This is part of the SQL definition of a 
view.

Here are the SQL rules for a view being updatable, from "SQL Instant 
Reference" by Martin Gruber, Sybex, ISBN 0-7821-4413-3:

"* It must be drawn on one and only one simply underlying table. In 
other words, no joins.

*It must contain one and only one query, in other words, no usage of 
UNION, EXCEPT, or INTERSECT

*If the simply underlying table is itself a view, that view also must be 
updatable

*The SELECT clause of the contained query may only specify column 
references, not value expressions or aggregate functions, and no 
column may be referenced more than once

*The contained query may not specify GROUP BY or HAVING

*The contained query may not specify DISTINCT."  

The books continues with this:

"These are fairly stringent restrictions, and some products may relax 
them."

And from the same book:

"As with a base table, the rows of a view are by definition unordered. 
Therefore, ORDER BY may not be specified."

Bill








Reply via email to