Re: dbcoltype char vs. datetimeoffset

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Mon, 23 Sep 2013 02:58:44 +0000
Chris Kings-Lynne <[email protected]> wrote:

> The dbcoltype() function returns code 47 for both varchar and
> datetimeoffset fields...is there any way to distinguish these - as
> they really are _rather_ different...

Less different than you might think, I'm afraid.  

If you connect to a server that supports datetimeoffset with TDS 7.2,
you're using a protocol for which no datetimeoffset datatype is
defined.  On your behalf, the server provides the data as a string,
which you see as VARCHAR.  That's what's known as backwards
compatibility.  

There are good reasons to update db-lib to support the new
datatypes, which after all are not so new anymore.  What is lacking
someone with time and interest.  

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