fixed GH #2807: Poco::Data::ODBC Binding of SQL Decimal Type

This commit is contained in:
Günter Obiltschnig 2019-10-14 15:17:20 +02:00
parent d658cc25e7
commit c15b6191b6

View File

@ -136,9 +136,18 @@ void ODBCMetaColumn::init()
case SQL_DECIMAL:
// Oracle has no INTEGER type - it's essentially NUMBER with 38 whole and
// 0 fractional digits. It also does not recognize SQL_BIGINT type,
// so the workaround here is to hardcode it to 32 bit integer
if (0 == _columnDesc.decimalDigits) setType(MetaColumn::FDT_INT32);
else setType(MetaColumn::FDT_DOUBLE);
// so the workaround here is to hardcode it to 32 or 64 bit integer
if (0 == _columnDesc.decimalDigits)
{
if (_columnDesc.size > 9)
setType(MetaColumn::FDT_INT64);
else
setType(MetaColumn::FDT_INT32);
}
else
{
setType(MetaColumn::FDT_DOUBLE);
}
break;
case SQL_REAL: