|| | |||Browse by category|
When trying to use an RWDBBulkInserter to insert a vector that is of size 1 with Sybase AL, you get the following syntax error:
Error code: 5
Error message [SERVERERROR] Incorrect syntax near 'foo'.
This error is caused when you attempt to insert a vector object of size 1 with a RWDBBulkInserter as in the following example:
RWDBConnection conn = aDB.connection() ;
conn.executeSql( "drop table foo" ) ;
conn.executeSql( "create table foo ( column1 int )" ) ;
RWDBTable table = aDB.table( "foo" ) ;
RWDBVector<int> vInt( ROWSIZE );
vInt = 0 ;
RWDBBulkInserter bInserter = table.bulkInserter( conn ) ;
bInserter << vInt ;
bInserter.execute( ROWSIZE ) ;
This error will be fixed in a future release of SourcePro DB. The fix entails using an RWDBInserter when inserting from a vector of size 1. You can use RWDBInserter in this vector size = 1 case as a workaround or you can increase the size of the vector to size >= 2.