Re: Using dbwritetext against Ms-Sql

Trygve Liland <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <41B6DF47EE2E3F49AC27D9B46E1DE68C17F52104@VITEMBX001.datakraftverk.no>
Thanks for feedback. 
We tried to downgrade to 7.0, but same result...
The project is run by a governmental specialist directorate in Norway, and I'm just trying to help out with the C code issues in my spare time :-)
I've instructed the programmer, to try the unit tests. 
Sorry we didn't try them first.

What I don't understand is that the text pointer is null.
This code should test for null values:
If (txtptr = dbtxptr(pqq->DbProc, 1)) == NULL) return;
And I dblib.c:
CHECK_NULP(textptr, "dbwritetext", 3, FAIL);
So I suspect this code I dblib.c:
dbconvert(dbproc, SYBBINARY, (BYTE *) textptr, textptrlen, SYBCHAR, (BYTE *) textptr_string, -1);
My textpointer is:
DBBINARY   txtPointer[DBTXPLEN]

I'll report again when the unit tests have been run.

Trygve

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Frediano Ziglio
Sent: 25. mai 2012 16:40
To: FreeTDS Development Group
Subject: Re: [freetds] Using dbwritetext against Ms-Sql

2012/5/25 James K. Lowden <[email protected]>:
> On Fri, 25 May 2012 12:15:33 +0000
> Trygve Liland <[email protected]> wrote:
>
>> The problem is that we are getting
>> tds_put_string: "writetext bulk IMAGECOLTAB.IMAGECOL
>> 0x00000000000000000000000000000000 timestamp = 0x0000000000000000 
>> with log" Invalid text, ntext, or image pointer value 
>> 0x00000000000000000000000000000000.
>>
>> Any idea on what we are doing wrong? I have checked code that we have 
>> in another program where we used dblib against Ms-Sqlserver, and I 
>> see more or less the same code.
>
> Those zeros are a problem, no doubt about it.
>
> Do the db-lib unit tests t0013.c and t0014.c work with your server?
> That would verify that dbwritetext() works with the TDS version you're 
> using.
>
> The log doesn't record the value of the textptr returned by dbtxtptr.
> If the server is sending a NULL textptr, see if that changes using TDS 
> 7.1.  If not, if you're receiving a good textptr from the server, you 
> need to find out why you're sending a NULL textptr.
>
> Hälsingar,
>
> --jkl

Try also to downgrade to 7.0 protocol.

MS decided to not return textptr with data even they still support TEXTPTR function on T-SQL, or better, they decide to always return an invalid textptr! I don't remember if was with 7.1 or 7.2... I don't really understand why...

Frediano
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
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.