Skip to Content.
Sympa Menu

freetds - dbdatlen with STRINGBIND

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: dbdatlen with STRINGBIND
  • Date: Fri, 12 Jul 2002 18:10:58 -0400


Bill,

I happen to be working at work with MS dblib, and came across some behavior
I'm surprised about. You might want to look at it yourself.

I'm working with datetime fields, where dbbind() was called with STRINGBIND,
so I get a null-terminated string in the default format representing the
date. It works fine; I get the date string sure enough, right as rain.

Interesting thing is, it seems dbdatlen() returns, not the string length, as
I'd expect, but 8! That's the size of the DBDATETIME structure. It appears
that in some cases at least when dblib converts datatypes for binding
purposes, dbdatlen() will return the size of the transmitted data rather
than that of the converted, bound data.

Please don't take my word for it; I'm looking at it closer for the next hour
or so at least. But I'm sure enough so far that I thought I should warn
you.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page