SQL embedded in RPGLE

10 pts.
Tags:
DB2
iSeries
performance
RPGLE
SQL
RPGLE program with five modules updating different set of files. Main module calls others each time a customer is being processed to change some specific detail in many files. There are many customers, so the modules are called many times (LR is set on only at the end of the whole process). Each module has many SQL updates in the form: - UPDATE xxx SET cc=bb WHERE mm=nn. There are no SELECT, CURSOR, OPEN, etc. My questions are: SQL creates access paths for every file and keeps them, so they will be reused in the next cycle? Or the access path is open and close each time? Or there are no access paths and SQL reads the whole file? NOTE: Those files updated by SQL do not have access paths according to the WHERE statement. Thanks for any answer. My main worry is performance as there are many customers with many many records and files to be updated.

Answer Wiki

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

You wll want to create SQL indexes on each file based on the where field(s)
I believe that you can run these interactively in Navigator and capture the necessary indexes.
With the correct indexes your SQL commands will find the record to update very much like a chain would.

Phil

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
  • Yorkshireman
    Run Performance monitor on the job in test. Make changes, differrent approaches - run PM on each oone. Analyse the results.
    5,580 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