[freetds] DBD::Sybase placeholder support

James K. Lowden jklowden at freetds.org
Mon May 12 20:47:26 EDT 2008


Dan Wierenga wrote:
> > At this point we know DBD::Sybase placeholders work with TDS 4.2 and
> > TDS
> > 5.0. 
> 
> 
> Attached are logs for TDS 7, 8, and 9, against both a SQL Server 2000
> server and a SQL Server 2005 server.

Dan, are they successes or failures are far as you're concerned?  It looks
good from here.  

Frediano wrote this part and I don't know it very well.  I looked at the
2000/7.0 log closely.  

Here's your request: 

net.c:673:Sending packet
0000 03 01 00 aa 00 00 01 00-0a 00 73 00 70 00 5f 00 |........ ..s.p._.|
0010 70 00 72 00 65 00 70 00-61 00 72 00 65 00 00 00 |p.r.e.p. a.r.e...|
0020 00 01 26 04 00 00 00 63-1e 00 00 00 1e 00 00 00 |..&....c ........|
0030 40 00 50 00 31 00 20 00-76 00 61 00 72 00 63 00 |@.P.1. . v.a.r.c.|
0040 68 00 61 00 72 00 28 00-38 00 30 00 29 00 00 00 |h.a.r.(. 8.0.)...|
0050 63 48 00 00 00 48 00 00-00 53 00 45 00 4c 00 45 |cH...H.. .S.E.L.E|
0060 00 43 00 54 00 20 00 62-00 61 00 72 00 20 00 46 |.C.T. .b .a.r. .F|
0070 00 52 00 4f 00 4d 00 20-00 64 00 61 00 6e 00 6f |.R.O.M.  .d.a.n.o|
0080 00 20 00 57 00 48 00 45-00 52 00 45 00 20 00 66 |. .W.H.E .R.E. .f|
0090 00 6f 00 6f 00 20 00 3d-00 20 00 40 00 50 00 31 |.o.o. .= . . at .P.1|
00a0 00 00 00 26 04 04 01 00-00 00                   |...&.... ..|

and you get back

net.c:542:Received packet
0000 81 01 00 00 00 09 00 26-04 03 62 00 61 00 72 00 |.......& ..b.a.r.|
0010 ff 11 00 c1 00 00 00 00-00 79 00 00 00 00 ac 0d |........ .y......|
0020 00 00 01 00 00 00 00 26-04 04 01 00 00 00 fe 00 |.......& ........|
0030 00 e0 00 00 00 00 00   -                        |.......|

which is 

token.c:526:processing result tokens.  marker is  81(TDS7_RESULT)
token.c:526:processing result tokens.  marker is  ff(DONEINPROC)
token.c:526:processing result tokens.  marker is  79(RETURNSTATUS)
token.c:526:processing result tokens.  marker is  ac(PARAM)
token.c:526:processing result tokens.  marker is  fe(DONEPROC)

The output parameter in detail:

ac 
0d 00 		13 bytes
00 		name length = 0
01 		nullable
00 00 00 00 	no usertype
26 		datatype 38, nullable integer
04 		colsize
04 		datalen
01 00 00 00 	value = 1

Then you send

0000 03 01 00 35 00 00 01 00-0a 00 73 00 70 00 5f 00 |...5.... ..s.p._.|
0010 65 00 78 00 65 00 63 00-75 00 74 00 65 00 00 00 |e.x.e.c. u.t.e...|
0020 00 00 26 04 04 01 00 00-00 00 00 af 05 00 05 00 |..&..... ........|
0030 7a 75 6d 6d 61         -                        |zumma|

and I don't understand that packet, but see

26 04 04 01 00 00-00 

which sure looks like you're sending that type 38 parameter, length 4,
value 1.  
You get back

0000 81 01 00 00 00 09 00 26-04 03 62 00 61 00 72 00 |.......& ..b.a.r.|
0010 d1 04 04 00 00 00 d1 04-04 00 00 00 ff 11 00 c1 |........ ........|
0020 00 02 00 00 00 79 00 00-00 00 fe 00 00 e0 00 00 |.....y.. ........|
0030 00 00 00               -                        |...|

which is 

token.c:526:processing result tokens.  marker is  81(TDS7_RESULT)
token.c:526:processing result tokens.  marker is  d1(ROW)
token.c:526:processing result tokens.  marker is  d1(ROW)
token.c:526:processing result tokens.  marker is  d1(ROW)
token.c:526:processing result tokens.  marker is  ff(DONEINPROC)
token.c:526:processing result tokens.  marker is  79(RETURNSTATUS)
token.c:526:processing result tokens.  marker is  fe(DONEPROC)

which doesn't look like you got back an output parameter.  Were you hoping
for one?  

--jkl





More information about the FreeTDS mailing list