VARCHAR(max) in SP output params with TDS>=7.2 and rpc API

Ramiro Morales <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAO7PdF-70Da7T7LyAEvP=g5sfD1XDvkZy-u05o6=AXCQgSqi6A@mail.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 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)."

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.