Skip to Content.
Sympa Menu

freetds - Re: [freetds] Problem with data type conversions and FreeTDS continued...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Problem with data type conversions and FreeTDS continued...
  • Date: Thu, 31 Jul 2003 20:54:01 -0000

Il gio, 2003-07-31 alle 15:19, James Vanns ha scritto:
> Background:
>
> Linux to M$ SQL Server 2000 (using FreeTDS 0.61 and TDS==8.0)
> Problem printing images/binaries and Unique Identifiers.
> Code below.
>
> OK, I have discovered more. The function tds_get_null() seems to think
> that the field containing the UID is null - when it isn't. SO in fact
> the tds_convert function is never called on that value.
>
> Why does tds_get_null think that the current row,column field is NULL
> when it contains that {45535-HHKSJOD-3456} thing!?
>
> Here's the code again:
> const string& tds::connection::print_field_as_string (const int &column)
> const {
> static string str;
> unsigned char *row = results->current_row;
> const int type = results->columns[column]->column_type;
> const int offset = results->columns[column]->column_offset;
> const int size = results->columns[column]->column_cur_size;
> const int conversion_type = tds_get_conversion_type (type, size);
>
> str.clear ();
>
> if (tds_get_null (row, column))
> str = "NULL";
> else {
> CONV_RESULT convert;
> unsigned char *value = row + offset;
>
> if (is_blob_type (type))
> value = (unsigned char*) ((TDSBLOBINFO *)
> value)->textvalue;
>
> if (tds_convert (context, conversion_type, (TDS_CHAR *)
> value, size, SYBVARCHAR, &convert) < 0)
> throw tds::error ("Failed to convert row type at
> column %d.", column + 1);
>
> str = convert.c;
> free (convert.c);
> }
>
> return str;
> }
>
>
> Any ideas? Thanks!
>
> Jim

Hi!
No, no idea. Try to set TDSDUMP and post results (you can remove all
lines before your query for security reasons).

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page