Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODBC: DataFormatException getting Time value from SQL Server #3801

Closed
MailShop opened this issue Sep 19, 2022 · 4 comments · Fixed by #4777
Closed

ODBC: DataFormatException getting Time value from SQL Server #3801

MailShop opened this issue Sep 19, 2022 · 4 comments · Fixed by #4777

Comments

@MailShop
Copy link
Contributor

MailShop commented Sep 19, 2022

Hi,

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: nanodbc/nanodbc#18

Pull request with a fix: #3802

@github-actions
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Sep 20, 2023
@Smurf-IV
Copy link

Why are pull requests being ignored ?

@github-actions github-actions bot removed the stale label Sep 21, 2023
Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Sep 20, 2024
Copy link

This issue was closed because it has been inactive for 60 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants