on 01-08-2010 4:04 PM
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
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.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.