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



Joe D wrote:
From: "David FOXWELL" <David.FOXWELL@xxxxxxxxx>
Also, this is the first time I've seen something like : fetch c1 for 50 rows into :arrDs; Does the number of rows have to be hard - coded?

I do not think the number of rows needs to be hard-coded for the program to work. If you do not limit the returned row count you would probably (hopefully?) get some sort of runtime exception if the array were overflowed. By hard-coding a number that is higher than I ever anticipate needing I have ensured myself of avoiding the overflow error. However, if my future need assessment proves to be faulty, hardcoding has now created an invisible bug: If there were 57 rows of matching data, I would only get the first 50 back and there would be no exception raised.

The SQLErrD(5) field in the SQLCA tells you whether or not the last available row was fetched from the cursor. So you can put the array-handling code in a loop and redo it as many times as necessary.

See section 7.8.3 'The FETCH statement' in 'Modernizing IBM eServer iSeries Application Data Access - A Roadmap Cornerstone', SG24-6396-00. Also, say that title 10 times fast.

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.