On 14 Jan 2011, at 11:06, Max Vlasov wrote:

> I understand this, but in my case the tables are objects also. So when I
> create a temporary trigger I should pass the table object context.

Dead easy: make the object context required to find the table a parameter to 
the function, and put the relevant value in when you create the trigger. Since 
you need a different trigger for each table this adds no extra work.

e.g.

CREATE TEMP TRIGGER :uniqname AFTER UPDATE ON :table FOR EACH ROW BEGIN SELECT 
rowid_changed(:tableptr,OLD.rowid,NEW.rowid) WHERE OLD.rowid != NEW.rowid; END;

And bind appropriate values to the :uniqname, :table and :tableptr placeholders 
for each trigger you create.

Best Regards,

Phil Willoughby
-- 
Managing Director, StrawberryCat Limited

StrawberryCat Limited is registered in England and Wales with Company No. 
7234809.

The registered office address of StrawberryCat Limited is:

107 Morgan Le Fay Drive
Eastleigh
SO53 4JH

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

Reply via email to