Hello
Environment: DB2 V8 LUW FP12.
I have a function that returns a table. I am trying to use it inside a
before trigger:
create trigger TRG.T_MACHINE_RTM
before insert on CAD.TBL_MACHINE
REFERENCING NEW as N
for EACH ROW
begin ATOMIC
insert into CAD.T_MACHINE_RTMDB select * from
TABLE(AFU.TABLE_DB_MID('x')) as A;
end@
When I run this I get the following error:
SQL0797N The trigger "TRG.T_MACHINE_RTM" is defined with an
unsupported
triggered SQL statement. LINE NUMBER=10. SQLSTATE=42987
I have also tried a variation: I converted the function to return a
VARCHAR, and changed my insert statement to use VALUES (x,y,
AFU.function). But I also got the same error.
Is there any way to make this work?
Thanks in advance,
Michel