Hi,
 
I don't think you can conditionally by-pass firing trigger. But you should be able to 
achieve similar result by "conditionally" let the trigger does nothing.
 
Here's an example.
 
Let's say I have a CONTROL_TABLE with a single column FLAG
If Flag = 0, fire trigger as normal
If Flag = 1, no triggered action
 
Transaction:
If t1 = 40
    update control_table set flag = 1
Else
    update control_table set flag = 0
End 
update dba.atab....
 
Inside your trigger:
First get the flag value from control_table
If flag = 0 then
 ..... trigger body...
End if;
... so, if flag <> 0, trigger is fired, but nothing will happen...
 
Just by 2c. Hope this help
 
Andy

        -----Original Message----- 
        From: Dusan Kolesar [mailto:[EMAIL PROTECTED] 
        Sent: 29/4/2004 (ææå) 15:42 
        To: Elke Schmidtke 
        Cc: SAP DB mailing list 
        Subject: Re: Again ignore trigger after update
        
        

        Hello,
        
        I think that statement inside trigger tr_upd_atab_1 is incorrect:
        update dba.atab_2 set  t2 = t2 + :val2, t3 = t3 + :val3 where t1 = 40
        ignore trigger;
        I have searched for it in documentation but I didn't found "ignore
        trigger" statement.
        I think there is no way how to ignore trigger just for one sql command,
        isn't it ?
        
        Regards Dusan.
        
        On Wed, 28 Apr 2004 13:45:13 +0200, Elke Schmidtke
        <[EMAIL PROTECTED]> wrote:
        
        > Hi all,
        > we made an update for our database from SAPDB7.4 to MAXDB and have
        > problems with triggers and procedures in which we use an update
        > trigger
        > with ignore trigger.
        > Thomas Anhaus wrote 26.04.04 that it should still work, but our
        > database crashes if we use the old triggers.
        > I made a very little test to see if it works or not.
        >
        > These are the statements:
        > create table atab_1(val1 int, val2 int, val3 int)
        > create table atab_2(t1 int, t2 int, t3 int)
        > create table atab_3(v1 int, v2 int, v3 int)
        > insert into atab_1 values (1,2,3)
        > insert into atab_2 values (10,20,30)
        > insert into atab_2 values (40,50,60)
        > create trigger tr_upd_atab_1 for atab_1 after update execute (
        > update dba.atab_2 set  t2 = t2 + :val2, t3 = t3 + :val3 where t1 = 10;
        > update dba.atab_2 set  t2 = t2 + :val2, t3 = t3 + :val3 where t1 = 40
        > ignore trigger;)
        > create trigger tr_upd_atab_2 for atab_2 after update execute (
        > insert into dba.atab_3 values (:t1, :t2, :t3);)
        > update atab_1 set val2=30 where val1=1
        >
        > After execute the last statement I expected 1 row in atab_3, but found
        > 2 !?
        >
        > What should we do now ?
        > Elke
        >
        
        --
        MaxDB Discussion Mailing List
        For list archives: http://lists.mysql.com/maxdb
        To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
        
        




____________________________________________________________
(c) 2003 Interactive Technology Holdings Limited Group.
All rights reserved.

CONFIDENTIALITY: This communication and any attachment(s)
is intended solely for the person or organisation to which
it is addressed and it may be confidential.  This
communication may contain confidential or legally privileged
material and may not be copied, redistributed or published
(in whole or in part) without our prior written consent.
This communication may have been intercepted, partially
destroyed, arrive late, incomplete or contain viruses and no
liability is accepted by any member of the Interactive
Technology Holdings Limited Group as a result.  If you are
not the intended recipient, employee or agent responsible
for delivering the message to the intended recipient you
must not copy, disclose, distribute or take any action in
reliance on it.  If you have received this communication in
error, please immediately reply and highlight the error to
the sender immediately and destroy the original from your
computer.

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to