Re: Stored procedures and multiple record set returns
Posted in 1998
Art S. Kagel wrote: > > Jacob Salomon wrote: > > Sighhh.... I have seen many features touted as "cool" turn ugly > > upon some basic analysis. Some cool features Informix truly lacks > > (like an array of structure variables to be returned in one swoop) > > and they --- SNIP --- > Jake, ESQL has had a FETCH_ARRAY feature, non-documented of course, > since 7.10. Art, I was referring to such an array of structures in SPL, which (last time I checked) does not support arrays or structure variables. I have been absently aware of the existence of the FETCH_ARRAY feature in ESQL for a while but I have an aversion to using features I can't read up on. > The library provides an extern long FetArrSize which you > can set to the number of rows to FETCH into the array each time the > FETCH is executed with the number of rows actually returned stored in > sqlca.sqlerrd[2]. For best results you would also take advantage of > the FetBufSize feature to set the size of the communication buffer > large enough to hold FetArrSize rows to minimize the network traffic > as much as possible. Since 1024 <= FetBufSize <= 32000 you can set > FetArrSize = FetBufSize / RowSize where RowSize is know or determined > from a DESCRIBE statement. Ming Chien reports that the feature > improves performance most for tables containing BLOBs (and presumable > any large row table) but the decrease in network traffic for smaller > row tables could be even more significant in increasing throughput in > a busy client-server environment. > > OK, this really returns a structure of arrays (one per column) so > maybe you are correct, but it is not hard to initialize an array of > structures containing pointers into the column arrays and keep going. A structure of arrays? A somewhat arguable method I have used in the past? The was an article by Bruce Eckel (I think) in Unix Review some years ago discussing this issue. After reading it I resolved to abandon that methodology and stick to a structure containing pointers to the arrays rather than the arrays themselves. Did Informix document the FETCH ARRAY in ESQL 7.3? Is there ANY endorsed documentation on this feature? -- -- Jake (Retrospectively realizes there is no future in hindsight) +------------------------------------------------------------+ | The expedient performance of a task with excessive concern | | regarding its duration-to-completion engenders a virtual | | certainty of diminished benefit therefrom. | | -- Benjamin Franklin (but he said it in 3 words) | +------------------------------------------------------------+