Can embedded SQL in a SQLRPGLE program be used as a stored procedure?

20 pts.
Tags:
Embedded SQL
iSeries development
iSeries RPG programming
RPG
RPGLE
SQL
SQLRPGLE
Stored Procedures
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?
ASKED: January 14, 2009  10:09 PM
UPDATED: January 15, 2009  3:48 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Yes it should work.
If I remember correctly, don’t close the cursor on result sets that you intend to return.
Phil

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following