Subject: ANSWER - Execute a store procedure in AS400 - ANSWE
I’ve had this problem too for a while and kept beating at it, and I’ve come up with the solution.
The .execProcedure needs to have a “Stored Procedure” cataloged on the 400. You can do so by programmatically by executing a “Create Procedure” before running the .execProcedure, then executing a “Drop Procedure” afterwords to clean up.
In my as400 program, I was also able to change one of the parms and use that changed parm in the lotus script.
Here’s some sample code:
sql = “Create Procedure Pgmmec074.Stan2 (In Parm1 Char(4), InOut Parm2 Char(7)) Language CL No SQL Parameter Style General”
I have other agents which updates and fetches information from AS400 and are working fine. I have those password in lower case.
If you don’t mind will you please send me the sample code of your agent which runs the store proc? Is my approach for running the store proc is correct?
I wouldn’t mind posting the code, but it is “extreemely complex”… that is - a lot of different script libraries are involved, using diffent kinds of classes etc. so it will only be confusing.
We do also have other agents accessing data on the iSeries machine using lower-case passwords… But the problem with calling the stored procedure was solved by specifying the password in upper case.