freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: shatam bhattacharya <shatam.bhattacharya AT gmail.com>
- To: freetds AT lists.ibiblio.org
- Subject: [freetds] Bulk upload problem
- Date: Sat, 10 Jul 2010 18:10:34 +0800
Hi Gurus,
This might have been discussed before, but googling did not help. So am
posting this question.
Recently our employer decided to move all strategic systems to MS Sql Server
from Sybase and for this we opted for freeTDS as the underlying connectivity
platform. We are using it for perl and c++ applications. While the perl
modules are working fine, one of the c++ apps has this wierd problem in bulk
upload. The problem is when we try to do a bulk upload it only inserts the
first row of the recordset. We have seen this both with temp table and
physical tables. Note that this problem is happening both in Sybase and MS
Sql Server uisng freeTDS libs.
The same c++ app works fine with the sybclient library on linux. Attached is
a sample log file dumped by freeTDS (the relevent db operations are around
the end of the log).
Is there a flag / option to tweek this and make it work. Please let me know
if you need any more detials about the application / library level
connectivity code / logs.
Any help is greatly appreciated.
Following is the code snippet to connect -
if( _ctLibShim->blk_init( _bulkDescriptor, CS_BLK_IN, const_cast< char* >(
_tableName.c_str() ), _tableName.length() ) != CS_SUCCEED )
{
throwReinitialisationError( "Failed to initialise the bulk descriptor
for table " + _tableName );
}
const int numberOfBindings( bindings_.size() );
ScopeGuard cancelBulkOperation( boost::bind(
&InternalBulkLoad::cancelBulkOperation, this ), _logger );
* for( int bindingIndex = 0; bindingIndex < numberOfBindings;
++bindingIndex )
{
bind( *bindings_[ bindingIndex ], bindingIndex + 1 );
}*
* if( _ctLibShim->blk_rowxfer( _bulkDescriptor ) != CS_SUCCEED )
{
throwReinitialisationError( "Failed to transfer the data into table "
+ _tableName );
}*
* if( _ctLibShim->blk_done( _bulkDescriptor, CS_BLK_ALL, NULL ) !=
CS_SUCCEED )
{
throwReinitialisationError( "Failed to commit the batch while loading
data into table " + _tableName );
}*
* * /*if( _ctLibShim->blk_drop( _bulkDescriptor ) != CS_SUCCEED )
{
throwReinitialisationError( "Failed to drop bulk descriptor while
loading data into table " + _tableName );
}*/
cancelBulkOperation.release();
--
Thanks and Regards,
Shatam Bhattacharya.
PK 2Qê<^Æ2
' ' mimetypeapplication/vnd.oasis.opendocument.textPK 2Qê<