Re: Empty string in db-lib

Damien Churchill <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On 7 May 2010 02:24, James K. Lowden <[email protected]> wrote:
> Damien Churchill wrote:
>> Is it possible to send an empty string as a parameter when making rpc
>> calls? All my efforts so far seem to result in the parameter ending up
>> being NULL when doing a trace on the server!
>
> It works.  Cf. src/dblib/unittests/rpc.c.
>
> I modified the .c and .sql of the unit test report errors if the NULL
> inputs don't arrive as NULL.  You might find the lastest revision a little
> clearer.
>
> http://manuals.sybase.com/onlinebooks/group-cnarc/cng1110e/dblib/@Generic__BookTextView/34413;pt=39614
>
> According to Sybase, "If the value of the RPC parameter is NULL, pass
> datalen as 0, even if type is a fixed-length datatype."  That's what the
> unit test does, and the server recognizes them as NULL.
>
> HTH.
>
> --jkl

>From that it looks like it isn't possible to just send an empty string
'' which of course is different to NULL? Is this a limitation of
db-lib or the TDS protocol?

Damien
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.