At 10:53 AM +0200 6/3/04, Pix wrote:
No... I need the id of the row inserted by the TRIGGER... the trigger operations should be atomic, so no other db activity should be a problem...

I still don't think you need last_insert_id. Try this in your trigger:

INSERT INTO OldContacts (ID, name, surname) VALUES (old.ID, old.name, old.surname);
UPDATE messages SET contactID = old.ID, contactWasDeleted=true


Of course, this version will be different, in that the rows in OldContacts will be exactly the same as those in contacts, including the ids, though the way I see it this conceptually is what should be happening. Your older version, if it works, would not preserve all of the contact row in OldContacts, as the ID value may change.

-- Darren Duncan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to