Groups > Interbase > Interbase SQL > Re: Trigger do not fire situations




Re: Trigger do not fire situations

Re: Trigger do not fire situations
Fri, 07 Mar 2008 12:21:54 +010
Marian,

> I have a trigger after update wich fire a stored procedure execution.
> If I make the update from IBConsole the trigger fire.
> From an IBX IBSQL component ... nothing.
> Transactions are read commited and separate for each IBX and table
trigger.
> Is there a catch ?
> 
> IBSQL sql:
> update BON_CASA
> set
> NRBON=:nrbon
> where CODDOC=:coddoc
> 
> 
> CREATE TRIGGER "UPDATE_RAPORTX" FOR "BON_CASA"
> ACTIVE AFTER UPDATE POSITION 1
> AS
> DECLARE VARIABLE INCASARE_LIBERA_V BOOLEAN;
>  BEGIN
>              INCASARE_LIBERA_V=FALSE;
>             IF (NEW.NRBON<>OLD.NRBON)
>              THEN EXECUTE PROCEDURE INSERT_BON_RAPX(BON_CASA.CODDOC, 
> :INCASARE_LIBERA_V, BON_CASA.CODGEST);
>  END

* Do you commit the transaction?
* Any chance that either NEW.NRBON or OLD.NRBON is NULL? In this case, 
you won't get to the EXECUTE PROCEDURE statement



-- 
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
Post Reply
Trigger do not fire situations
Fri, 7 Mar 2008 12:43:38 +0200
Hi !
I have a trigger after update wich fire a stored procedure execution.
If I make the update from IBConsole the trigger fire.
From an IBX IBSQL component ... nothing.
Transactions are read commited and separate for each IBX and table trigger.
Is there a catch ?

IBSQL sql:
update BON_CASA
set
NRBON=:nrbon
where CODDOC=:coddoc


CREATE TRIGGER "UPDATE_RAPORTX" FOR "BON_CASA"
ACTIVE AFTER UPDATE POSITION 1
AS
DECLARE VARIABLE INCASARE_LIBERA_V BOOLEAN;
 BEGIN
             INCASARE_LIBERA_V=FALSE;
            IF (NEW.NRBON<>OLD.NRBON)
             THEN EXECUTE PROCEDURE INSERT_BON_RAPX(BON_CASA.CODDOC, 
:INCASARE_LIBERA_V, BON_CASA.CODGEST);
 END

Post Reply
Re: Trigger do not fire situations
Fri, 7 Mar 2008 14:43:03 +0200
Tom,
Trigger work fine if the update is made by IBConsole, directly in Data grid 
or by isql ... so ... trigger is good ... I guess :-).
"Thomas Steinmaurer"
<t.steinmaurer_dontbugmewithspam@upscene.com> wrote in 
message news:47d1251a$1@newsgroups.borland.com...
> Marian,
>
>> I have a trigger after update wich fire a stored procedure execution.
>> If I make the update from IBConsole the trigger fire.
>> From an IBX IBSQL component ... nothing.
>> Transactions are read commited and separate for each IBX and table 
>> trigger.
>> Is there a catch ?
>>
>> IBSQL sql:
>> update BON_CASA
>> set
>> NRBON=:nrbon
>> where CODDOC=:coddoc
>>
>>
>> CREATE TRIGGER "UPDATE_RAPORTX" FOR "BON_CASA"
>> ACTIVE AFTER UPDATE POSITION 1
>> AS
>> DECLARE VARIABLE INCASARE_LIBERA_V BOOLEAN;
>>  BEGIN
>>              INCASARE_LIBERA_V=FALSE;
>>             IF (NEW.NRBON<>OLD.NRBON)
>>              THEN EXECUTE PROCEDURE INSERT_BON_RAPX(BON_CASA.CODDOC, 
>> :INCASARE_LIBERA_V, BON_CASA.CODGEST);
>>  END
>
> * Do you commit the transaction?
> * Any chance that either NEW.NRBON or OLD.NRBON is NULL? In this case, you

> won't get to the EXECUTE PROCEDURE statement
>
>
>
> -- 
> Best Regards,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2
> Upscene Productions
> http://www.upscene.com 

Post Reply
Re: Trigger do not fire situations
Fri, 7 Mar 2008 14:44:25 +0200
And ... Yes I commited
"Thomas Steinmaurer"
<t.steinmaurer_dontbugmewithspam@upscene.com> wrote in 
message news:47d1251a$1@newsgroups.borland.com...
> Marian,
>
>> I have a trigger after update wich fire a stored procedure execution.
>> If I make the update from IBConsole the trigger fire.
>> From an IBX IBSQL component ... nothing.
>> Transactions are read commited and separate for each IBX and table 
>> trigger.
>> Is there a catch ?
>>
>> IBSQL sql:
>> update BON_CASA
>> set
>> NRBON=:nrbon
>> where CODDOC=:coddoc
>>
>>
>> CREATE TRIGGER "UPDATE_RAPORTX" FOR "BON_CASA"
>> ACTIVE AFTER UPDATE POSITION 1
>> AS
>> DECLARE VARIABLE INCASARE_LIBERA_V BOOLEAN;
>>  BEGIN
>>              INCASARE_LIBERA_V=FALSE;
>>             IF (NEW.NRBON<>OLD.NRBON)
>>              THEN EXECUTE PROCEDURE INSERT_BON_RAPX(BON_CASA.CODDOC, 
>> :INCASARE_LIBERA_V, BON_CASA.CODGEST);
>>  END
>
> * Do you commit the transaction?
> * Any chance that either NEW.NRBON or OLD.NRBON is NULL? In this case, you

> won't get to the EXECUTE PROCEDURE statement
>
>
>
> -- 
> Best Regards,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2
> Upscene Productions
> http://www.upscene.com 

Post Reply
Re: Trigger do not fire situations
Fri, 7 Mar 2008 14:55:01 +0200
Apologize Tom !
Old. was null.
Thank you very much.
"Thomas Steinmaurer"
<t.steinmaurer_dontbugmewithspam@upscene.com> wrote in 
message news:47d1251a$1@newsgroups.borland.com...
> Marian,
>
>> I have a trigger after update wich fire a stored procedure execution.
>> If I make the update from IBConsole the trigger fire.
>> From an IBX IBSQL component ... nothing.
>> Transactions are read commited and separate for each IBX and table 
>> trigger.
>> Is there a catch ?
>>
>> IBSQL sql:
>> update BON_CASA
>> set
>> NRBON=:nrbon
>> where CODDOC=:coddoc
>>
>>
>> CREATE TRIGGER "UPDATE_RAPORTX" FOR "BON_CASA"
>> ACTIVE AFTER UPDATE POSITION 1
>> AS
>> DECLARE VARIABLE INCASARE_LIBERA_V BOOLEAN;
>>  BEGIN
>>              INCASARE_LIBERA_V=FALSE;
>>             IF (NEW.NRBON<>OLD.NRBON)
>>              THEN EXECUTE PROCEDURE INSERT_BON_RAPX(BON_CASA.CODDOC, 
>> :INCASARE_LIBERA_V, BON_CASA.CODGEST);
>>  END
>
> * Do you commit the transaction?
> * Any chance that either NEW.NRBON or OLD.NRBON is NULL? In this case, you

> won't get to the EXECUTE PROCEDURE statement
>
>
>
> -- 
> Best Regards,
> Thomas Steinmaurer
> LogManager Series - Logging/Auditing Suites supporting
> InterBase, Firebird, Advantage Database, MS SQL Server and
> NexusDB V2
> Upscene Productions
> http://www.upscene.com 

Post Reply
about | contact