× 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.



Hi Daniel,

(Open > Fetch > Close) x 1.260 times, Declare Cursor only once.

TIA
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno mer 21 ago 2024 alle ore 12:01 Daniel Gross <daniel@xxxxxxxx> ha
scritto:

Hi Marco,

Am 21.08.2024 um 10:43 schrieb Marco Facchinetti <
marco.facchinetti@xxxxxxxxx>:

Hi Daniel, thanks for you time.

You're very welcome.

I agree about data sets and, when possible, I design SQL acces in that
way
but in this specific program obtaining the customer's list (ABCDUTENTE)
is
too complex with SQL.

I also often think that - sometimes you have to find a "middle way".

The program with the cursor works and is completely satisfactory but I
would like to know why with the Select the times are so high. Is it a
problem in the links between the tables? In the conditions or in the
sequence in which they are specified?

Yes - all those things shouldn't - but can have an influence on the
statement execution.

Do I understand the code correctly - you only fetch ONE row and then close
the cursor again?

Or do you leave the cursor open, and fetch one row after another in a loop?

What puzzles me is why a cursor is so fast (2/3 SECONDS) and a Select
takes
20 MINUTES. The code of the Select and of the Cursor is exactly the same
and the general logic too: will be executed 1.260 times.

Yes - those differences are really big - that looks suspicious.

Regards,
Daniel
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.