Skip to Content.
Sympa Menu

freetds - Re: [freetds] VARCHAR(max) in SP output params with TDS>=7.2 and rpc API

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] VARCHAR(max) in SP output params with TDS>=7.2 and rpc API
  • Date: Thu, 4 Dec 2014 10:19:37 +0000

2014-11-23 18:31 GMT+00:00 Ramiro Morales <cramm0 AT gmail.com>:
> Hi all,
>
> I've found FreeTDS master can't handle the new in TDS 7.2 ability to
> handle values longer than 8000 chars.
>
> I've opened a merge request which adds tests that show the failure:
>
> https://gitorious.org/freetds/freetds/merge_requests/32
>

I saw the request. However tests should work with every version of
Sybase/MSSQL

> I tried to modify the RPC parameter handling rpc API code to get this
> working by following what can be read at
> http://www.freetds.org/tds.html#login7 ('Types' sub-section):
>
> There is a call-out in that table for the XSYBVARBINARY, XSYBVARCHAR
> and XSYBNVARCHAR data types that reads:
>
> "* Under TDS 7.2+ these types allow size to be -1, representing
> varchar(max), varbinary(max) and nvarchar(max)."
>

This is true for protocol however I wouldn't use -1 as maxlen in
dbrpcparam call. maxlen define the buffer length for the pointer too.
I personally would pass the buffer byte length and if does not fit
into a normal (N)VARCHAR a (N)VARCHAR(MAX) should be used
automatically.

> Unfortuately my attemps were unsuccessful. I suspect what is described
> there doesn't apply to the RPC SP API.
>
> Any hints on how these data types need to be represented on the wire
> are welcome. I'd be willing to try to implement the required changes.
>
> Regards,
>
> PS: My use case is about output parameters, but it's possible input
> ones also need work. See https://github.com/pymssql/pymssql/issues/275
>
> --
> Ramiro Morales
> @ramiromorales

Frediano



  • Re: [freetds] VARCHAR(max) in SP output params with TDS>=7.2 and rpc API, Frediano Ziglio, 12/04/2014

Archive powered by MHonArc 2.6.24.

Top of Page