cancel
Showing results for 
Search instead for 
Did you mean: 

ODBC 7.7.06.09 cannot fetch columns of type TIMESTAMP

Former Member
0 Kudos

Hi,

it seems the 7.7 ODBC driver of the community release of MaxDB cannot fetch TIMESTAMP columns with SQLBindCol

In a new database with the tutorial data loaded, I created a new table with

create table TEST ("ID" INTEGER not null, "TS" TIMESTAMP) sample 20000 rows

Then I insert a row with

 insert into TEST values(1, now()) 

The following C++ code


SQLExecDirect(hstmt, (SQLWCHAR *) L"SELECT ID, TS FROM TEST", SQL_NTS);
 SQLBindCol(hstmt, 1, SQL_C_SLONG, &id, sizeof id, &cbId);
 SQLBindCol(hstmt, 2, SQL_C_TYPE_TIMESTAMP, &datetime, sizeof datetime, &cbDatetime);
 SQLFetch(hstmt);

fails with

[SAP AG][SDBODBC DLL][MaxDB] General error;-10413 Illegal TIMESTAMP value for parameter/column (2)

Thanks,

Gub

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

When using Binary type:

 SQLBindCol(hstmt, 2, SQL_C_BINARY, &buffer, sizeof buffer, &cbDatetime);

the fetch returns success but the result is truncated . The buffer contains the ascii string:

"2010010817____________"

(with _ being space character.)

TTK
Employee
Employee
0 Kudos

Hello

I could not reproduce the bug with the current 7.7 driver, which is available for you via this [link|https://sapmats-de.sap-ag.de/download/download.cgi?id=X0JPGT3NHRLALHIHOKQBX1OKFKEK80EO3IAS9NEZ5L3BONBK7T].

Kind regards Thomas

Former Member
0 Kudos

Thank you Thomas,

I could not reproduce it either with the 7.7.07.14 driver you provided me.

Is this driver version also available for x64 windows system ?

Best regards,

Gub

TTK
Employee
Employee
0 Kudos

[Yes, here|https://sapmats-de.sap-ag.de/download/download.cgi?id=S9WERA1MXHBL5EM0Z83S6ZXADK3S0U2E645CJSKAZY6LB2K7IC]

Kind regards Thomas

Former Member
0 Kudos

It works also in 64-bits. I just found a minor issue with traces ; I will open a new topic for it.

Answers (0)