DB-ALLe allows to set special query behaviours using the "query" parameter. The available options are:
When using this option, those functions will return right after performing the query, and the results will be read later using idba_elencamele or idba_dammelo. As a side effect, idba_quantesono and idba_voglioquesto cannot know in advance the result count, and will return some undefined value in it.
When using this option, the only way to find out when to stop reading is to know that idba_elencamele and idba_dammelo will set all the output parameters to undefined when there is no more data to read. One could thus use a loop like this:
call idba_setc (handle, "query", "stream")
c Make the query
call idba_voglioquesto (handle, N)
c Iterate the results. Ignore N because it is
c meaningless when using query=stream
do
call idba_dammelo (handle, varname)
c If ana_id is missing value, then we are done
idba_enqi(handle, "ana_id", value)
if (value .eq. 2147483647) exit
c ...process the data...
enddo
This option can be a significant improvement in speed and memory when the result count is not needed in advance. The speed improvement comes because the client can start doing computations on the results while the server is still generating the results, taking advantage of parallelism, especially if the server and the application are on two different computers.
Without using this option, the client cannot start to use the results until the server has finished computing and trasmitting them.