cancel
Showing results for 
Search instead for 
Did you mean: 

How to insert multiple rows

Former Member
0 Kudos

I am new to MaxDB, how do you insert multiple rows to the table

Thanks for your help

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Please check this weblog

/people/kathirvel.balakrishnan2/blog/2005/08/19/inserting-multiple-records-from-xml-files-into-maxdb-database

Cheers

Kathir~

Former Member
0 Kudos

Hi,

Please find the solution below,

/people/kathirvel.balakrishnan2/blog/2005/08/15/inserting-multiple-records-into-maxdb-database

Cheers

Kathir~

Former Member
0 Kudos

Hi Sam,

Check this one hope this will be helpful.

/people/kathirvel.balakrishnan2/blog/2005/01/25/batch-mode-operation-in-maxdb-using-maxdb-loader-and-java

cheers

Kathir~

0 Kudos

Hello,

it depends on the kind of interface do you use. For JDBC the following code snippet give you an example:

int numverOfRows = 100;
//prepare a statement
PreparedStatement batchInsert = connection.prepareStatement("INSERT INTO MYTABLE values (?,?)");
//add values
for (int i = 0; i < numverOfRows; ++i) {
  batchInsert.setInt(1, i);              
  batchInsert.setString(2, "VALUE_"+i);
  batchInsert.addBatch();
}
//execute the insert statement
batchInsert.executeUpdate();

Hope that helps,

Marco