title: How to speed up odbc insert
body: <p>So what I'm doing is reading a lot of data from remote Nettezza database and inserting them into another remote Oracle database. For that I'm using ODBC driver. The problem is that there is a lot of data and it takes too much time. How can I speed up? 
  Here is what I do:</p>
  
  <p>First I create connection and command for inserting:</p>
  
  <pre><code>String connect = "Driver={Microsoft ODBC for Oracle};CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=myprt))(CONNECT_DATA=(SERVICE_NAME=myname)));Uid=uid;Pwd=pass";
          connection = new OdbcConnection(connect);
          connection.Open();
          String q = @"INSERT INTO TEST (id)
          VALUES (?)";
          myCommand = new OdbcCommand(q,connection);
  </code></pre>
  
  <p>Then I read data from netteza:</p>
  
  <pre><code> String connect = "Driver={NetezzaSQL};servername=server;port=5480;database=db; username=user;password=pass;
          string query = @"SELECT T2.LETO_MESEC, T1.* 
                          FROM data T1 
                          JOIN datga2 T2 ON T2.ID = T1.EFT_ID 
                          WHERE T2.LETO_MESEC = '" + mesec + @"'";
              using (OdbcConnection connection = new OdbcConnection(connect))
              {
                  try
                  {
                      OdbcCommand command = new OdbcCommand(query, connection);
                      connection.Open();
                      OdbcDataReader reader = command.ExecuteReader();
                      int counter=0;
                      while (reader.Read())
                      {
                          int id_first = reader.GetInt32(5);
  
                          insertOracle(id_first);
                      }
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("ne dela" + e.ToString());
                  }
              }
  </code></pre>
  
  <p>And finally my insert :</p>
  
  <pre><code> public void insertOracle(int id_first)
      {
  
              try
              {
                  myCommand.Parameters.Clear();
                  myCommand.Parameters.Add(new OdbcParameter("id", id_first));
                  myCommand.ExecuteNonQuery();
              }
              catch (Exception e)
              {
                  Console.WriteLine("ne dela" + e.ToString());
              }
  
      }
  </code></pre>
  
  <p>I noticed that these commit in every line, so how to remove that and speed it up. Right now it takes about 10 minutes for 20000 rows.</p>