basil thomas wrote:
2) stored procedures - I know the response will probably be a flat at "NO because SQLite is not a client/server database and if you want that feature use xxx instead". I just would like to save my queries inside the database without having to recompile them again. Very simple as we seem to have triggers already and they look just like the stored procedures that I would like to create. No flow control and access to passed in variables only.

You might want to check out http://www.sqlite.org/capi3.html to see the features already built in for this (section 2.3, "User-defined functions"). This takes care of ugly calculations at any rate.


As for storing queries, I'm not sure how useful this feature is given that the database engine itself is part of your program. For simple queries your best bet is a static sqlite3_stmt object, which you prepare once at program initiation and refer back to each time it is needed. Just remember to reset the statement after each query execution. For more complex logic you can couple this trick with functions that choose which query to execute.

Clay Dowling


-- http://www.lazarusid.com/notes/ Lazarus Notes Articles and Commentary on Web Development

Reply via email to