Sybase AL: syntax error when trying to bulk insert a vector object of size 1

Article ID: 1121
Last updated: 31 Jan, 2008
Article ID: 1121
Last updated: 31 Jan, 2008
Revision: 1
Views: 4834
Posted: 29 Jun, 2001
by Dean J.
Updated: 31 Jan, 2008
by Dean J.
Problem


When trying to use an RWDBBulkInserter to insert a vector that is of size 1 with Sybase AL, you get the following syntax error:

#code

Error code:       5
Error message     [SERVERERROR] Incorrect syntax near 'foo'.




Cause


This error is caused when you attempt to insert a vector object of size 1 with a RWDBBulkInserter as in the following example:

 

#code

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] = 0 ;

RWDBBulkInserter bInserter = table.bulkInserter( conn ) ;

 

bInserter << vInt ;

bInserter.execute( ROWSIZE ) ;




Action


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. 

 

This article was:   Helpful | Not helpful
Report an issue
Article ID: 1121
Last updated: 31 Jan, 2008
Revision: 1
Views: 4834
Posted: 29 Jun, 2001 by Dean J.
Updated: 31 Jan, 2008 by Dean J.
Also listed in


Others in this category