Thanks Dennis for your reply.
I would like to avoid triggers for performance reasons.
I haven't found an official solution so I am implementing my own sqlite3_update_notify API that is executed before the operation takes place.

---
Marco Bambini
http://www.sqlabs.net
http://www.sqlabs.net/blog/
http://www.sqlabs.net/realsqlserver/



On Oct 18, 2007, at 4:41 PM, Dennis Cote wrote:

Marco Bambini wrote:

with sqlite3_update_hook I can get the rowid of the row AFTER it has been INSERTed, DELETEd or UPDATEd. Is there a way to get the rowid of a row BEFORE it is DELETEd or UPDATEd ?
If not, can someone suggest a good approach to this problem?

Marco,

You can use a "before update on table" or "before delete on table" trigger to get the rowid of the row before it is deleted. You can access the value old.rowid from within the trigger and save it into another table for example. See http://www.sqlite.org/ lang_createtrigger.html for more details.

HTH
Dennis Cote

---------------------------------------------------------------------- -------
To unsubscribe, send email to [EMAIL PROTECTED]
---------------------------------------------------------------------- -------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to