The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
I get a DataFormatException getting time values from SQL Server. Example:
Session session("ODBC", "Driver=ODBC Driver 17 for SQL Server;Server=[...];Database=[...];Trusted_Connection=yes;");
session << "CREATE TABLE TimeTestTable (ok int, bad time)", now;
session << "INSERT INTO TimeTestTable (ok, bad) VALUES ( 1, '12:34:56')", now;
Statement s(session);
//s << "SELECT ok FROM TimeTestTable WHERE ok=1", now; //this works fine
s << "SELECT bad FROM TimeTestTable WHERE ok=1", now; //this throws DataFormatException("Unsupported data type.")
Poco::Data::RecordSet rs(s);
Looks like SQL Server's ODBC driver returns a custom type, SQL_SS_TIME2 (-154), rather than the standard value.
Not the only project to notice this problem: https://github.com/nanodbc/nanodbc/issues/18
Hi,
I get a DataFormatException getting time values from SQL Server. Example:
Looks like SQL Server's ODBC driver returns a custom type, SQL_SS_TIME2 (-154), rather than the standard value. Not the only project to notice this problem: https://github.com/nanodbc/nanodbc/issues/18
Pull request with a fix: https://github.com/pocoproject/poco/pull/3802