Unanswered: can we call DB2 stored procedure from DB2 triggers
Hi, I am working in db2 version 7 under windows 2000. Basically i am porting oracle triggers to DB2 triggers. With some limitations in DB2 triggers (like cursors ), I wanna write those logic in stored procs and call those stored procs from my triggers. Can I do this?
Having real hard time porting oracle triggers to DB2 triggers!! Can anyone help me out please!
Surely we can call stored procedures from a trigger.
A single trigger can fire off a UDF and/or stored procedure to invoke an external action.
There is currently a safe limit to the cascading of triggers, stored procedures, and UDFs - runtime nesting depth of 16.
Go through the SQL reference for the exact syntax for the same.
-Prashant G Dahalkar
hmmmm....i am also having problems calling a sp from a trigger....
CREATE TRIGGER tri_herman1
AFTER INSERT ON HERMAN1
REFERENCING NEW AS n
FOR EACH ROW MODE DB2SQL
CALL trans_pcd('table','s','a',current timestamp,null,123,'1');
This is the error message i receive:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "CALL trans_pcd" was found following "MODE
DB2SQL ". Expected tokens may include: "<values>". LINE NUMBER=5.