stored procs & return values
camber at ais.org
Wed Dec 19 19:38:52 EST 2001
I'm not sure what the current status of output parameter support is, but I
do know it worked at one point in time (at least with dblib). See
tds_process_param_result() in token.c for details. Probably the best
thing would be unittests for dblib, ctlib, and ODBC to ensure that we can
regression test changes between releases, any takers?
On Tue, 18 Dec 2001, Steven Campbell wrote:
> 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
> You are currently subscribed to freetds as: [camber at ais.org]
> To unsubscribe, forward this message to $subst('Email.Unsub')
More information about the FreeTDS