Subject Re: [firebird-support] Why IN AUTONOMOUS TRANSACTION doesnt work here?
Author Alan McDonald


Yes Mark, no doubt about that, but: Why?

It is in a trigger "before insert or update"

Is the insert or update action rejected before the trigger is executed? Then it is impossible to use IN AUTONOMOUS TRANSACTION in a trigger and save the error in a table.

And that would be very useful.

Greetings.

Walter.

Use an external table to log errors. They are not subject to transactions.
Alan


On Thu, Sep 19, 2013 at 6:17 AM, Mark Rotteveel <mark@...> wrote:
 

On 18-9-2013 22:12, W O wrote:
> In the trigger EMPLEADOS_BIU is the sentence "INSERT INTO ERRORES..."
> but a row is inserted into the table ERRORES only if there are no errors.
>
> This works fine:
>
> INSERT INTO EMPLEADOS (EMP_NOMBRE, EMP_APELLD) VALUES ('JUAN', 'PEREZ');
>
> but it doesnt work:
>
> INSERT INTO EMPLEADOS (EMP_NOMBRE, EMP_APELLD) VALUES
> ('JUAN5678901234567890123', 'PEREZ');
>
> because the length of EMP_NOMBRE is greater than 20, but:
>
> Why is not a row inserted into the table ERRORES?

The statement probably never gets executed at all because it already
fails when the parameter values are checked and deemed too long.

Mark
--
Mark Rotteveel







--
regards
Alan McDonald