Re: Multiple "When" in Trigger
Posted in 1997
JoSchneidr wrote:
} Hy out there,
} my question may sound strange but is there a possibility to have more
} then one WHEN-Condition in a trigger ?
}
} I tried out something like this :
}
} create trigger example1
} insert on tab_1 referencing new as not_old
} for each row when (a=1) (execute spl_1());
} when (a=2) (execute spl_2());
}
} I tried out multiple version with changing syntax but there is always a syntax
} error
} after the first "when" condition.
}
} Any help would be appreciated.
Schneidr,
I saw couple of suggestions using SP, infact you can get it done in trigger
itself, the uasge is as below :
create trigger example1insert on tab_1 referencing new as not_old
for each row when (a=1) (execute spl_1()), -- Notice this use of "," to
continue
when (a=2) (execute spl_2()); -- Notice this use of ";"
to finish.
Hope this helps you.
--
Have a nice day
Felix K. Mathews
mailto:fmathews@systems.dhl.com