Can A System Trigger Call A Sql Stored Proc?
I’ve created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE TRIGGER statement.) I’ve also defined a SQL stored proc, and the trigger is set to call this SP. I’ve posted the simplified source below. I can manually call the stored proc, and the external trigger is created without any errors. However, when I do an insert into the table in question, the trigger returns an error (posted below). I believe my problem is either 1) I’m not accepting the trigger buffer contents correctly in the stored proc, or 2) you simply can’t have an external trigger call a SQL stored proc. (I don’t believe #2 is the problem, based on the docs, but I could be wrong.) I believe #1 is the problem, but I can’t find any example in the docs or any redbooks that show how to have a system trigger call a SQL stored proc. What I’m actually after is the RRN that is passed in inside the tri