Skip to Content.
Sympa Menu

freetds - stored procs & return values

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steven Campbell <scampbell AT jamedia.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: stored procs & return values
  • Date: Tue, 18 Dec 2001 17:17:39 -0500


As proven by my last (rather misguided) email, I need to get stored procedures with return statuses and output parameters working.

My production server is WNT 4.0 running SQL Server 7.0 SP3. I'm running TDS version 7.0 against this SQL Server.

I have successfully patched php-4.1.0 to do the output_params and return_status functions for sybase_ct. But it's starting to look like FreeTDS doesn't know how to handle stored procedure output parameters, or at least it isn't handling it the same as Sybase's CTLib is.

I've been investigating how the SQL Server and the ctlib return values from stored procs, and hope to have something whipped up quickly.

But I'm trying to decode FreeTDS's return packet from the stored proc. In my /tmp/freetds.log dump file, i've got this:

pid: 32476:Received packet @ 2001-12-18 16:15:41
0000 81 01 00 00 00 01 00 6c 11 26 00 0e 49 00 5f 00 |.......l.&..I._.|
0010 4c 00 61 00 62 00 65 00 6c 00 5f 00 49 00 44 00 |L.a.b.e.l._.I.D.|
0020 5f 00 4f 00 55 00 54 00 d1 05 01 90 51 0a 00 ff |_.O.U.T.....Q...|
0030 01 00 c1 00 01 00 00 00 79 00 00 00 00 fe 00 00 |........y.......|
0040 e0 00 01 00 00 00 |......|
pid: 32476:2001-12-18 16:15:41 processing result tokens. marker is 81
pid: 32476:2001-12-18 16:15:41 processing result tokens. marker is d1

Now, there has been a stored procedure executed, and the column name returned is I_Label_ID_OUT. The I_Label_ID_OUT's value is 90510a in "network byte order".

I'm looking at http://www.freetds.org/tds.html and I can decipher some of it, but getting baffled trying to figure out the column name length and how to determine the type of data returned, along with the name of the output variable.

Thanks to anyone who can shed some light on this one.

Steven Campbell






Archive powered by MHonArc 2.6.24.

Top of Page