You could always create a table that stores the pragma values in which
you're interested, then have code that checks on start up to set those
pragmas to those values.

On Tue, Aug 23, 2011 at 1:24 PM, Erik Lechak <e...@lechak.info> wrote:
> Hello all,
>
> Is there a way to save pragma states to the database?
>
> I have a delete trigger that I would like to fire off on a delete (
> actually a replace), but I need the database to maintain the "pragma
> recursive_triggers=1" state.  Otherwise the trigger does not get
> fired.  I would just like the database to remember that I set the
> state to true.
>
> Here is some example code.  If it works when "pragma
> recursive_triggers=1", but not when "pragma recursive_triggers=0":
>
>
> drop table abc;
> drop table abc_history;
>
> create table if not exists abc (id integer primary key,a text, b text, c 
> text);
> create table if not exists abc_history as select * from abc where rowid=-1;
>
> create trigger if not exists abc_delete_trigger
> before delete on abc
> begin
> insert into abc_history select * from abc where rowid=old.rowid ;
> end;
>
> create trigger if not exists abc_update_trigger
> before update on abc
> begin
> insert into abc_history select * where rowid=old.rowid ;
> end;
>
> insert into abc values(1,'xa','y','z');
> insert into abc values(2,'xb','y','z');
> insert into abc values(3,'xc','y','z');
> insert into abc values(4,'xd','y','z');
>
> replace into abc values(1,'xg','y','z');
>
> Thanks,
> Erik Lechak
> _______________________________________________
> 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