Skip to Content.
Sympa Menu

freetds - RE: Output parameters (was: Strange things)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: Output parameters (was: Strange things)
  • Date: Fri, 15 Nov 2002 18:42:01 -0500


> From: Frediano Ziglio [mailto:freddyz77 AT tin.it]
> Sent: November 15, 2002 6:27 PM

> Il ven, 2002-11-15 alle 19:44, Castellano, Nicholas ha scritto:
> > Agreed that it's different...but experimentation shows we
> > don't get anything
> > at all that might provide information about the output
> > parameters in a TDS7
> > stream for this type of query. The returned stream looks
> > pretty much
> > identical to what we get using TDS4.2, with the 0xAC token stream
> > conspicuously missing.
>
> Nick you have to use dynamic query or RPC. If you exec
> statement like "EXEC sp_test 1, 2, 3" you do not receive
> output parameters.
> Try to call an RPC on sp_test or exec a dynamic query and
> you'll see output parameters (in either TDS5 and TDS7)

Nick is talking about src/dblib/unittests/t0022.c

I just compiled and ran that program on NT, linked to Microsoft's libraries,
and we do indeed get t a TDS_RETURNVALUE (0xAC) from a

Microsoft SQL Server 2000 - 8.00.194 (Intel X86)
Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation
Standard Edition on Windows NT 4.0 (Build 1381: Service Pack 6)

server. The reply looks like this:

ac TDS_RETURNVALUE
0f00 15 bytes
02 2 byte namelength
4062 "@b" is the name
01 Status, should be 0 or 8 under TDS 5
38000000 User Type SYBINT4
26 data type SYBINTN
04 MaxLen of data type is 4 bytes
04 ActualLen is 4 bytes
2a000000 result is 42, as expected
fe TDS_DONEPROC
0000 Status is TDS_DONE_FINAL

[now things get weird]
e0 TDS_RPC from the server ??? out of spec!
0001 Length of remaining data is one byte, a lie
00 NameLen is 0
0000 no Options used

[end of response from server]

I haven't decoded the message just before that one, from client to server,
executing the proc. I've run out of time. Here're the raw data:

0x0070 5c00 5000 4900 5000 4500 5c00 0000 0000 \.P.I.P.E.\.....
0x0080 0101 0032 0000 0100 6465 636c 6172 6520 ...2....declare.
0x0090 4062 2069 6e74 0a65 7865 6320 2374 3030 @b.int.exec.#t00
0x00a0 3232 2040 6220 3d20 4062 206f 7574 7075 22.@b.=. AT b.outpu
0x00b0 740a t.

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page