Kaydet (Commit) a18632bf authored tarafından Ocke.Janssen's avatar Ocke.Janssen

dba34b: #i115384# check if the length of BIT > 1 otherwise use setBoolean, and…

dba34b: #i115384# check if the length of BIT > 1 otherwise use setBoolean, and change typeinfo for ado types
üst f9416a7f
...@@ -1178,8 +1178,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou ...@@ -1178,8 +1178,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
aSourceColTypes.reserve( nCount + 1 ); aSourceColTypes.reserve( nCount + 1 );
aSourceColTypes.push_back( -1 ); // just to avoid a everytime i-1 call aSourceColTypes.push_back( -1 ); // just to avoid a everytime i-1 call
::std::vector< sal_Int32 > aSourcePrec;
aSourcePrec.reserve( nCount + 1 );
aSourcePrec.push_back( -1 ); // just to avoid a everytime i-1 call
for ( sal_Int32 k=1; k <= nCount; ++k ) for ( sal_Int32 k=1; k <= nCount; ++k )
{
aSourceColTypes.push_back( xMeta->getColumnType( k ) ); aSourceColTypes.push_back( xMeta->getColumnType( k ) );
aSourcePrec.push_back( xMeta->getPrecision( k ) );
}
// now create, fill and execute the prepared statement // now create, fill and execute the prepared statement
Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnMapping ), UNO_SET_THROW ); Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnMapping ), UNO_SET_THROW );
...@@ -1291,7 +1298,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou ...@@ -1291,7 +1298,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
case DataType::LONGVARBINARY: case DataType::LONGVARBINARY:
case DataType::BINARY: case DataType::BINARY:
case DataType::VARBINARY: case DataType::VARBINARY:
case DataType::BIT:
aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes );
break; break;
...@@ -1307,6 +1313,13 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou ...@@ -1307,6 +1313,13 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp );
break; break;
case DataType::BIT:
if ( aSourcePrec[nSourceColumn] > 1 )
{
aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes );
break;
}
// run through
case DataType::BOOLEAN: case DataType::BOOLEAN:
aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean ); aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean );
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment