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?