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



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 10/17/2017 02:15:21
PM:
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 10/17/2017 02:03:20
PM:
also, another small side concern, what if i ever have column
definitions
greater than the 255 chars we defined g_hostData with?

You can increase the length of the host data elements as needed.

You can even make the host data array pointer-based and dynamically
allocate its storage at execution time to avoid any possible issue with
trying to allocate too much storage in the program, itself.


Furthermore, you can even calculate the buffer size needed at
execution time, dynamically allocate that buffer, and use an array of
pointers (and pointer arithmetic) for the position of each fetched column
in the buffer. This way there is never any underallocation or
overallocation for the fetched data.

Otherwise, your choice is to fetch multiple rows so that SQL
builds each row as a contiguous alignment of the column data -- like that
article talks about for multi-row fetches. In this case you just have to
keep track of the number of rows you've fetched and which row is the
current row for passing back to the caller.


Sincerely,

Dave Clark

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.