On 3/15/08, Jay A. Kreibich <[EMAIL PROTECTED]> wrote: > On Sat, Mar 15, 2008 at 10:39:44PM +0100, Fabiano Sidler scratched on the > wall: > > Hi folks! > > > create view dbapp as > > > > SELECTing from dbapp is not the problem, I get the desired output. What > > doesn't work is INSERTing into dbapp! I'd like to add fields via > > > http://www.sqlite.org/lang_createview.html > > "You cannot COPY, DELETE, INSERT or UPDATE a view. Views are > read-only in SQLite. However, in many cases you can use a > TRIGGER on the view to accomplish the same thing." >
http://www.sqlite.org/lang_createtrigger.html Triggers may be created on views, as well as ordinary tables, by specifying INSTEAD OF in the CREATE TRIGGER statement. If one or more ON INSERT, ON DELETE or ON UPDATE triggers are defined on a view, then it is not an error to execute an INSERT, DELETE or UPDATE statement on the view, respectively. Thereafter, executing an INSERT, DELETE or UPDATE on the view causes the associated triggers to fire. The real tables underlying the view are not modified (except possibly explicitly, by a trigger program). I don't have an answer for him (never created a TRIGGER on a VIEW), but Fabiano is on the right track. > > > -- > Jay A. Kreibich < J A Y @ K R E I B I.C H > > > "'People who live in bamboo houses should not throw pandas.' Jesus said > that." > - "The Ninja", www.AskANinja.com, "Special Delivery 10: Pop!Tech 2006" > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://punkish.eidesis.org/ Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/ Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users