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: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] I can't get the datatype DATE correctly using odbc, anyone can help me?
  • Date: 09 Jan 2003 11:32:31 +0100

> SQLDescribeCol(m_hstmt, col + 1, (SQLCHAR *) name, \
> sizeof(name), NULL, &colType, &colSize, \
> &colScale, &colNullable);
> switch(colType)
> {
> ...
> case SQL_TYPE_TIMESTAMP:
> colType = SQL_C_CHAR;

Here you set type to char ...

> {
> TIMESTAMP_STRUCT tstamp;
> memset((void*) &tstamp, 0, sizeof(TIMESTAMP_STRUCT));
> SQLGetData(m_hstmt, col + 1, colType, &tstamp, colSize + 1,
> &cbSize);
> ....

So you get char into a structure...

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page