Skip to Content.
Sympa Menu

freetds - dbresults...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Bill Thompson" <thompbil AT exchange.uk.ml.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: dbresults...
  • Date: Fri, 20 Sep 2002 09:57:40 -0400


Hi,

I've spotted something, whilst researching how to implement the compute
columns functionality.

In dblibrary, after a dbsqlexec() thats going to return data, if we do
more than one call to dbresults(), things go wrong.

try changing the relevant code in dblib/unittests/t0001.c to:

fprintf(stdout, "select\n");
dbcmd(dbproc,"select * from #dblib0001 order by i");
dbsqlexec(dbproc);
add_bread_crumb();


while (dbresults(dbproc) != NO_MORE_RESULTS)
{
/* noop */
}
add_bread_crumb();

for (i=1;i<=dbnumcols(dbproc);i++)
....

and see what happens (especially in the tdsdump!)

The sybase manual for dbresults says:

"To ensure that dbresults is called the correct number of times, Sybase
strongly recommends that dbresults always be called in a loop that
terminates when dbresults returns NO_MORE_RESULTS."

I've dabbled in token.c before, and will take a look at how to fix this,
but if anyone more experienced gets to the answer quicker than me (not
difficult) let me know.

Bill




Archive powered by MHonArc 2.6.24.

Top of Page