How to call a stored procedure in AS400? What command do I use to call the stored procedure it may be either through RPG, CL, or SQL call. How do we pass the input/output parameters in the stored procedure? Does the stored procedure return any value like function returns?
Use
SQL CALL
statement to run the stored procedure in AS400. On the CALL statement, specify the stored procedure name and any parameters if required. The parameters include constants, special registers, host variables, or expression and SQL variables. To run the stored procedure, try to call using the name specified on the CREATE PROCEDURE statement. For example, consider a simple SQL stored procedure as follows:To run this stored procedure, use the
SQL CALL
statement as follows:CALL SQLInsertProc('TEST', '1')