rpg sql

15 pts.
Tags:
Dynamic SQL
RPGLE
SQL
I am using dynamic sql in an rpgle pgm. This pgm is called from 2 different menu options. When I take the 2nd option, everything works fine. I exit out of that option and take the first option. Everything is still work fine. I exit the first option and go back to the 2nd option and the pgm hangs up when I open the cursor in the sql open statement. I am sure the cursor has been closed. Anyone have any suggestions? Thanks.

Answer Wiki

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

Hi,

Can you take a look at the open files for the job and see whether the files are still open? Do you have any OVRDBF’s in place?

Try a RCLRSC between menu options and see whether that makes any difference.

Regards,

Martin Gilbert.

============================================================

Do not use RCLRSC at all unless you are <b>certain</b> that all active processes are OPM. If you have ILE activation groups in your job (and you quite possibly do if you’re executing any number of IBM functions, not to mention your own application code), you can mess things up real quick.

Most likely the RPGSQL programs/modules need to be recompiled with appropriate options to close cursors properly.

Show the compile options that were used, including SQL options. Suggestions can be given that may be more appropriate.

Tom

Discuss This Question: 1  Reply

 
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
  • Sloopy
    "I am sure the cursor has been closed". So was I, with some of my embedded SQL programs! But, I was wrong. Make sure that there is only one way out of your program, and that way out closes the cursor(s) and sets *INLR = *ON. RCLRSC will close open files, but does not always have an effect on the SQL cursor, especially if you are running it between options in a menu-based application, because the call level at which the command is run may be higher than the cursor level. Sloopy
    2,195 pointsBadges:
    report

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