Fetch more than one row
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hello to all, first of all thank you for all the response on my posting from Tue, 26 Jan 1999. I found the idea of Art S. Kagel very interesting but unfortunately i have to work on ESQL/C V5.0 and INFONL V5.0 and therefore can't compile his tool. So i have to bother you with one more Question: Is it possible to fetch several rows with one FETCH-statement in ESQL/C V5.0? What are the tricks to do it? Thank you -- Mathias Cukina COMLINE GmbH Dortmund/Germany EMail mathias.cukina@comline.de
Mathias Cukina wrote: > Hello to all, > > first of all thank you for all the response on my posting from Tue, 26 > Jan 1999. > I found the idea of Art S. Kagel very interesting but unfortunately i > have to work on ESQL/C V5.0 and INFONL V5.0 and therefore can't compile > his tool. > > So i have to bother you with one more Question: > > Is it possible to fetch several rows with one FETCH-statement in ESQL/C > V5.0? No, it isn't possible. You'll need to do the fetch within a loop, and break from the loop when you've finished. I usually do it something like this: while (TRUE) { EXEC SQL fetch ...... if (sqlca.sqlcode == SQLNOTFOUND) break; .... } CYA! Anthony -- Anthony Burkitt Systems Engineer - Library Division Geac Computers (Australia) anthony@geac.com.au
Mathias Cukina wrote: > > Hello to all, > > first of all thank you for all the response on my posting from Tue, 26 > Jan 1999. > I found the idea of Art S. Kagel very interesting but unfortunately i > have to work on ESQL/C V5.0 and INFONL V5.0 and therefore can't compile > his tool. > > So i have to bother you with one more Question: > > Is it possible to fetch several rows with one FETCH-statement in ESQL/C > V5.0? > What are the tricks to do it? Little known trick which has become practical now that IConnect and Client SDK are FREE! Install Client SDK 2.10 and the latest IConnect 7.3x??? to make a 7.3x developement/runtime environment. Set INFORMIXSERVER to the name of the 5.xx server, INFORMIXDIR to the 7.3x runtime directory, and create an sqlhosts file in $INFORMIXDIR/etc to point to the 5.xx engine. NOW you can compile 7.xx specific code and run it against a 5.xx engine as long as you do not do anything that is not legal for 5.xx (like trying to connect to the engine without a database name). Look at the source for myschema.ec or dbcopy.ec to see how to correctly connect to 5.xx engines from 5.xx code using the CONNECT TO statement. Now you are free to use FetArraySize and FetBufSize. BTW a bonus 7.xx ESQL/C code runs a bit faster against 5.xx databases than 5.xx ESQL/C does! Art S. Kagel