now this raises questions:

eg:
CREATE TABLE clients .......
CREATE VIEW getclients AS select * from clients.....

now if I update the 'getlist' view that will with a instead of trigger 
update the clients table

that will raise the triggers for the client table, I am right?

----- Original Message ----- 
From: "Kees Nuyt" <[EMAIL PROTECTED]>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Sent: Thursday, August 14, 2008 8:59 PM
Subject: Re: [sqlite] is there a pragma to disable triggers?


> On Mon, 11 Aug 2008 13:16:45 +0300, you wrote:
>
>>Hello,
>>
>>I am working on a syncing project and I do have a lot of triggers to 
>>read/write foreign keys.
>>And while I do the sync of one table the triggers are causing a strange 
>>effect (as the other table is not yet synced).
>>Is there a pragma to disable triggers on the sqlite database?
>
> Perhaps you can solve the problem with "INSTEAD OF" triggers
> on one or more views. Yes, that's possible: a view is
> `virtually` updatable when you define triggers for all
> statements that will be used to update the view.
> It is a very powerful mechanism.
>
> The updatable view can be (almost) any select or join and
> has to contain all columns of all tables that you need to
> update with the INSERT | UPDATE view_name statements. All
> foreign key contraints would be handled by the INSTEAD OF
> triggers if all your updates are performed on those views
> instead of tables.
>
> sql-statement ::=
> CREATE [TEMP | TEMPORARY] TRIGGER
> [IF NOT EXISTS] trigger-name
> INSTEAD OF database-event
> ON [database-name .] view-name
> trigger-action
>
> database-event ::=
> DELETE | INSERT | UPDATE | UPDATE OF
> column-list
>
> http://www.sqlite.org/lang_createtrigger.html
>
>>Regards,
>>Marton
>
> I hope this helps.
> -- 
>  (  Kees Nuyt
>  )
> c[_]
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users 

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to