|
On Tue, 2003-11-18 at 20:04, Bob cozzi wrote: > Scott, > Maybe IBM should drop support for the READ/WRITE/OPEN/CLOSE/UPDATE opcodes > so that we are forced to upgrade and/or purchase SQL. <vbg> > What I meant by fixed-format can be ugly is that any code can be ugly, but > mixing SQL and /FREE is always ugly. > > Bob Cozzi > Cozzi Consulting > www.rpgiv.com > And as long as we're cross posting, this was the follow on to the earlier ugly code: ================================= A perfectly valid complaint, and one that I share, but let's acknowledge that /free is only half the problem in this case. Not only do I think the /free.../end-free should be unnecessary, I also think there should be a much less kludgy way of executing SQL than /exec sql.../end-exec. And as you point out, the combination is truly annoying. And it is for this reason that I typically house all my SQL statements in seperate procedures, so that the same mainline would look something like this: <psuedo-code> d masterDS e ds extname(CUSTMAST) prefix(m_) /free myHostVariable = 'Select * from myLib/myFile' ; prepareCursor(); fetchMaster(); dow sqlStt <> '00000' ; // do stuff fetchMaster(); enddo ; shutDown(); /end-free </psuedo-code> At least from my point of view this is much more preferrable. ===================================== Joel Cochran http://www.rpgnext.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.