× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



> From: James Rich
> 
> Can this be restructured in such a way that it doesn't required
opening
> and closing the cursor for every iteration through the loop?

Feel free to tell me how.  If you cannot, you have to leave them in,
because that's what is necessary for a single record fetch.


> That seems
> awful wasteful and could be responsible for a large amount of the
> performance difference.  Maybe SQL is still slower, but it seems like
this
> opening/closing of the cursor needs to be removed from the loop in
order
> to make an appropriate comparison.  If they can't be removed, this
seems
> like another example of the shortcomings of the way SQL is used within
RPG
> more than a problem with SQL itself.

Why is it different in any other language?  To fetch a record, you have
to create a cursor to do so.  Please, show me a better way.


> It is also interesting to consider the differences between SQL and RPG
I/O
> for single record access.  For example, when exactly is the file
pointer
> set for the chain operation?  If another chain immediately follows
that
> fetches the next sequential record, is the file pointer reset before
> reading the file, or does the system know that it is already set to
the
> right spot and just leaves it alone?

There is something to this; I reversed the order on the chain and it
increased the load 60% on the RPG without affecting the SQL.  Still,
that's 6-to-1 for RPG.

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.