20 pts.
 Can embedded SQL in a SQLRPGLE program be used as a stored procedure?
I am successfully using (external) stored procedures with many RPGLE programs. (Some of these are SQLRPGLE programs because they return a result set.) All of this works fine. But if I try to replace some of the RPG I/O in a RPGLE program with embedded SQL, creating a SQLRPGLE program, and run it as a stored procedure, I get a SQL error. I can call the same program from another program and it runs fiine. It is as if this double use of SQL is a no-no. Is there a way to use embedded SQL in a SQLRPGLE program and be able to run it as a stored procedure?

Software/Hardware used:
ASKED: January 14, 2009  10:09 PM
UPDATED: January 15, 2009  3:48 PM

Answer Wiki:
Yes it should work. If I remember correctly, don't close the cursor on result sets that you intend to return. Phil
Last Wiki Answer Submitted:  January 15, 2009  1:50 pm  by  philpl1jb   44,130 pts.
All Answer Wiki Contributors:  philpl1jb   44,130 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _