> Try this:
>
> CREATE TRIGGER trig_insert BEFORE INSERT ON tab
>     WHEN (new.champ1 LIKE "%-%")
> BEGIN
>     insert into tab(champ1) values (strftime("%s", new.champ1));
>     select RAISE(IGNORE);
> END;
It works perfectly. Thank you. I had tryed a similar solution, but I
didn't know how to stop operation after the insert. Now I know :)

>> So do you know if it is possible to modify new columns ?
>> It is important to me to modify them in a "BEFORE" trigger, because
>> if I
>> do it in an "AFTER" trigger, I would have to use an UPDATE query and
>> it
>> would lead to a deadlock (I also have some triggers on the UPDATE
>> statement...).
>
> A deadlock? In a single-threaded operation? How exactly do you expect
> this to happen?

I mean that I had a trigger on "INSERT" that executes an update, and I had
some  triggers on "UPDATE" that executes any other updates... So it was an
infernal loop.

Thank you for helping, Igor.


Charly CAULET

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

Reply via email to