Skip to Content.
Sympa Menu

freetds - Re: [freetds] I can't get the datatype DATE correctly using odbc, anyone can help me?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] I can't get the datatype DATE correctly using odbc, anyone can help me?
  • Date: Thu, 9 Jan 2003 09:43:21 -0500

On Wed, 8 Jan 2003 17:09:52 -0500, "Ou Liu" <ou AT qbt.com> wrote:
> I am using FreeTDS/iODBC to get some date from a MSSQL2K Server,
> however I
> met problem when I try to get data of type DATE. Here is my problem
> (1) I am using SPARC/Solaris 8 as client machine, iODBC as driver
> manager,
> FreeTDS as odbc driver, MSSQL2K on another Win2K machine as server.
> (2) I create a table 'test' on the MSSQL2k:
> CREATE TABLE test (dtm DATETIME);
> INSERT INTO test VALUES("2002-02-23 10:02:03");
> (3) Now I use the tsql to fetch the whole table :
> SELECT * FROM test;
> Everything runs ok, I got what I need.
> (4) But When I try to use ODBC API to get it:(the m_hstmt is ok, I
> am sure)

Ou,

Could you please submit a src/odbc/unittest that illustrates what you're
doing? You've defined a very narrow problem in C that should work but is
subject to Endian breakage. Someone else might well want to do the same
thing and benefit from your example. And a simple test program would make
it easy to debug your problem.

You don't even have to create a temporary table (though of course you
can). Your query could be just "select getdate()".

If you do that, I'll add your program to the distribution and make it
work.

Regards,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page