RE: Sybase Module 0.36 Output Parameter Handling

"Bradley Feldman" <[email protected]> Thu, 17 Mar 2005 12:33:36 -0800
Newsgroups gmane.comp.python.sybase
Message-ID <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAl26AvnJDdE2pAhSiEiAYTsKAAAAQAAAAKgW0hCyVs0KFLmDu2sB4KgEAAAAA@relevantevidence.com>
I tried the code Dave (and Skip) suggested, but I still can't seem to find
the value of the returned parameters, even through fetchall/nextset calls.
Also, using a debugger I don't see anything being passed back to the buf
object.

I'm wondering if the issue has something to do that I'm using Sybase 0.36
module with FreeTDS 0.62 and MS SQL Server 2000.  I'm assuming that it all
works on Sybase 9.0 and that it's Microsoft munging everything up.

So, I tried to upgrade to a later version of FreeTDS (0.63 or higher)-- I
read somewhere that later version is handling output parameters better.
Everything is now built straight from source.  When I fire up python and try
to "import Sybase" I get an error saying "Import Error: libct.so.2 - cannot
open shared object file"  Upon further investigation I see that FreeTDS
0.63+ does not produce a libct.so.2 -- only a libct.so.3.

So, is there something that can be easily fixed within Sybase module to link
with libct.so.3 instead of libct.so.2?

BTW, Here's a test I performed to see if the new FreeTDS and MS SQL Server
are communicating properly:

--------------------------------
FreeTDS Version 0.64.dev.20050317

Using tsql with the following simple example:

1>DECLARE @ReturnValue int
2>SELECT @ReturnValue = 3
3>EXEC sp_TestSproc 12345, @ReturnValue OUTPUT
4>SELECT @ReturnValue
5>go
(return status = 0)

55
---------------------------

So that proves that FreeTDS and tsql are passing and returning parameters
correctly to/from MS SQL Server 2000 because the value of @ReturnValue is
changed from 3 to 55 upon execution of the Stored Procedure.

All I need now is instructions for how to see the return value using the
Python Sybase 0.36 module and I'm good to go!

Any ideas from anyone?

*Bradley