On 14 Jan 2011, at 10:45, Max Vlasov wrote: > Phil, it's an interesting solution. I will probably use it, but the current > problem is that I have to resolve object context from non-oop function. It's > possible (maybe even by hard-coding pointer as one of parameters in the > trigger statement), but your variant is very elegant so I should think also > of something similarly elegant :) You also mentioned at least one sane way > of using select inside the trigger body. I'm not so familiar with triggers, > just wondering is there some other examples of useful selects inside > triggers bodies
I use SQLite from Objective-C, so I also have to restore the oo-context I want when user-defined functions are invoked. The 5th parameter to sqlite3_create_function & friends (void *pApp) is your friend. You retrieve it at invocation-time with sqlite3_user_data(ctx) where ctx is the sqlite3_context pointer passed to your non-OO wrapper routine. 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