poco icon indicating copy to clipboard operation
poco copied to clipboard

ODBC issue binding string column

Open ni3que opened this issue 7 years ago • 3 comments

I've upgraded from Poco 1.7.9 to 1.8.1. Now I'm facing an issue using the sybase SQL Anywhere 16 odbc driver on Windows. Binding of string columns is no longer possible.

Session sess( "ODBC", dsn ); std::vector<string> versions; string guid = "someguid"; sess << "select szDBVersion from LXG_FIRMA where szGUID=?", use( guid ), into( versions ), now;

A "LengthExceededException" is being raised. This is due to a change in Binder::getColSizeAndPrecision. The first call to "_pTypeInfo->tryGetInfo(cDataType, "COLUMN_SIZE", tmp)" is returning "false", which causes the exception.

Am i doing something wrong or is this a bug in the latest poco version?

POCO version

1.8.1

Compiler and version

VS2015

Operating system and version

Win10

Thanks in advance, Marko

ni3que avatar Jan 28 '18 20:01 ni3que

It is a fix for bug. doing this right is hard because different back ends have different ways of determining the length limit. fix has been tested with Oracle, SQLServer, MySQL and PostgreSQL, but not with sybase. So, if you can help provide the right algorithm there, the fix will be easier.

aleks-f avatar Jan 29 '18 16:01 aleks-f

Thanks aleks-f for your response! Not sure if my knowledge is deep enough to provide a reliable patch for the problem. Will try it...

Kind regards, Marko

ni3que avatar Jan 29 '18 18:01 ni3que

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

github-actions[bot] avatar Dec 23 '23 02:12 github-actions[bot]

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

github-actions[bot] avatar Feb 22 '24 02:02 github-actions[bot]