On Wed, Jun 24, 2009 at 9:17 AM, Michal Seliga<michal.sel...@visicom.sk> wrote: > hi > > in my application i sometimes must insert huge amount of pre-prepared data so > i > don't want triggers to do any action while i am inserting them > > for this reason i created one small table which is normally empty, however if > it > contains record set to 1 triggers shoudl not do any action. to make this > happen > i use triggers like this following example > > CREATE TRIGGER sync_Activity_oninsert after insert on Activity > for each row > when (not exists(select * from sync_block where sub_block=1)) > begin > --action > end; > > to block triggers i do: insert into sync_block values(1); > to enable them back i do: delete from sync_block; > > > this helped to stop triggers from doing any action, but they still launch and > in > result import of data takes 2x more with triggers then without them. > > is there any other, faster, way to temporarily disable triggers? > > i found one more possibility, someone recommended it on this list in year 2005 > that its possible to list all create trigger statements from database, drop > them, make action and recreate them back. this will work, but time for > creating > so many triggers (yes, they are many) may be also very bad. in addition it > doesn't seem as very nice solution to me... > > the most prefered way for me would be to use some pragma to disable triggers, > but looking to documentation i wasn't able to find any...
I agree, I would too like a way to temporarily disable triggers. I found the need to do so when I wanted to insert something in a table, but didn't want the trigger to update the fts table automatically (fts was creating some problem at that time). Would be nice to do something like '... WITHOUT USING TRIGGERS ... ' or a "pragma triggers_on = 1|0;" > > maybe someone has any other idea? > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://www.punkish.org/ Carbon Model http://carbonmodel.org/ Charter Member, Open Source Geospatial Foundation http://www.osgeo.org/ Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor/ Nelson Institute, UW-Madison http://www.nelson.wisc.edu/ ----------------------------------------------------------------------- collaborate, communicate, compete ======================================================================= _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users