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



There are absolutists which state "if you are using cursors you are doing
it wrong". Their belief is often that, if it takes any calculation
between an input and an output, then you should limit yourself to an RPG
read and RPG output operations. I kind of find that poppycock.

Another of their beliefs is that, if you can do "set at a time" updates
then you should. Like
update mytable set payrate=payrate * :hostPayFactor where dept=
:hostSelectedDepartment;
This I have no problem with. Putting that in a cursor makes no sense.

Now, as to your particular situation...
While you did supply your sql statement I don't understand the
recommendation for a cursor. I'm wondering if I do not have all the
information. For example,
Is your statement in a do loop in which some other operation updates one
of the other files involved? For example
do loop...
read thisfile;
// do some calculations
open postFile;
write postFile;
close postFile;
execsql update thisfile set thisfile.colB=postfile.col27 where
thisfile.colA = postfile.col01;
loop...
If this is the case then, yes, you should look at a cursor.

Rob Berendt

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.