Pix wrote:
> Suppose I've some tables like these:
>
> CREATE TABLE contacts (ID, name, surname);
> CREATE TABLE oldContacts (ID, name, surname);
> CREATE TABLE messages (message, contactID, contactWasDeleted default
> NULL);
>
> I wrote a trigger similar to this:
>
> CREATE TRIGGER OnDeleteContact
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,
At 5:38 PM +0200 6/2/04, Pix wrote:
There is a way to have the right last_inserted_rowid() ?
Don't use it. Instead, try substituting the string "old.id" for
"last_insert_rowid()". You already know what the contact id is
because its in "old.id". Moreover, "last_insert_rowid()" is
completely
Suppose I've some tables like these:
CREATE TABLE contacts (ID, name, surname);
CREATE TABLE oldContacts (ID, name, surname);
CREATE TABLE messages (message, contactID, contactWasDeleted default NULL);
I wrote a trigger similar to this:
CREATE TRIGGER OnDeleteContact BEFORE DELETE ON Contacts
FOR
4 matches
Mail list logo