Re: FreeTDS and PHP: empty strings and NVARCHAR

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4cK9Kwg3Ewp0f9mb5nK-U2+KABxbcjtBEv6Ms94uwp+5g@mail.gmail.com>
2011/7/11 Mattia <[email protected]>:
> 2011/7/11 Frediano Ziglio:
>> However I'm pondering if is not better to pass always strings as
>> unicode.
>
> This is the behavior of the Sql Server's Management Studio.
>
> When will the patch arrive? ;-)
>
> If you need a beta-tester, I'm here.
>

No time to test currently but this should do (src/dblib/rpc.c)


@@ -170,6 +170,9 @@ dbrpcparam(DBPROCESS * dbproc, const char
paramname[], BYTE status, int type, DB
 	CHECK_CONN(FAIL);
 	CHECK_PARAMETER(dbproc->rpc, SYBERPCS, FAIL);

+	if (type == SYBVARCHAR && IS_TDS7_PLUS(dbproc->tds_socket))
+		type == XSYBNVARCHAR;
+
 	/* validate datalen parameter */

 	if (is_fixed_type(type)) {


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