db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Demir <dem...@yahoo.com>
Subject Re: Use of If control statement in row level trigger
Date Fri, 12 Aug 2005 05:23:13 GMT
Conditionally firing the trigger is not supported yet if i remember 
correct, but you can carry the IF condition into the where clause.

Example:

create trigger S.TRIGNAME
after update of COL1 on S.T1
referencing NEW as N OLD as O
for each row mode db2sql
insert into S.T2(COLN)
select COLX
from S.T3
where (not N.COL1=O.COL1);


This will insert nothing if the condition (not N.COL1=O.COL1) evaluates to 
FALSE. [may need to check for NULLs separately if cols are nullable in 
these things]

It will feel like trigger did not fire.

Regards,
Suavi


At 10:03 PM 8/11/2005, you wrote:
>Hi,
>
>Can any one help? I would like to use the IF control statement in row level
>trigger. I do not find any detail related to it in manual and on web
>site.If any
>have Idea about it please post me a example.
>
>Waiting for your reply.
>
>Thanks and  Regrds,
>
>Sube Singh

Mime
View raw message