[freetds] dbrpcsend() returning prematurely
Tim Cook
tim at palare.demon.co.uk
Fri Jul 13 09:58:03 EDT 2007
I've got some code that works fine with Sybase/db-lib but exhibits
the following problem when running with freetds version 0.64:
I execute a stored procedure using the following calls:
dbrpcinit()
dbrpcparam() ...
dbrpcsend()
dbsqlok()
dbresults(dbproc)
The stored procedure does an update then executes the following code
to return a single row/column to the caller
if @@rowcount = 1
select 1
else
select 0
The application fails when it attempts to do a dbbind(). Further
investigation revealed that dbnumcols() is returning 0 indicating
that the select hasn't been performed. I put some debug output in the
stored procedure and the interesting thing I noticed is that dbsqlok
() has returned *before* all the debug output from the stored
procedure has been displayed. Its as if the "update" has been
performed, sqldbok() returns but because the select hasn't been
executed there is no data to return.
Has anybody else had this problem? I'm assuming dbsqlok() waits until
the stored procedure has completed but in my case it looks as if it
hasn't.
I checked against the Sybase build and the stored procedure in both
cases is being executed with exactly the same parameters being passed
in.
Tim
More information about the FreeTDS
mailing list