Thank you! It work's fine.. Sylko
-----Ursprüngliche Nachricht----- Von: Stephen Oberholtzer [mailto:[EMAIL PROTECTED] Gesendet: Montag, 23. April 2007 15:42 An: sqlite-users@sqlite.org Betreff: Re: [sqlite] INSTEAD OF Trigger Question On 4/23/07, Sylko Zschiedrich <[EMAIL PROTECTED]> wrote: > Hi all, > > i have a question to "instead of triggers" on views. > > Following schema: > <snip> h> > That's my current implementation. But with this I can't update the View > to 'null' values because the coalesce statement will return the > old.values. > > How can I handle that? > Can I "detect" the columns to update? Actually, you don't need to. the OLD and NEW pseudotables don't contain just the data affected by the update; it includes the *complete* row before the update (in OLD) and after the update (in NEW). I have attached a sqlite3 script demonstrating this; just run it with sqlite3 < sqlite-view-update.sql to see the results. A final warning: there is a gross inefficiency in the way updates on views are handled. If your view is big -- i.e. "select count(*) from myview" reports more than about 100K rows -- your update is going to take inexplicably long. I'm pondering a patch for that. -- -- Stevie-O Real programmers use COPY CON PROGRAM.EXE ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------