Skip to Content.
Sympa Menu

freetds - [freetds] dbrpcsend() returning prematurely

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Tim Cook <tim AT palare.demon.co.uk>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] dbrpcsend() returning prematurely
  • Date: Fri, 13 Jul 2007 14:58:03 +0100


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





Archive powered by MHonArc 2.6.24.

Top of Page