title: Teradata JDBC Error 1338 after certain number of batch executions
body: <p>I am trying to insert 3.8M records into a Teradata table containing 14 columns, through a batch of 10000 records using <code>RJDBC</code> package of R.
  It always crashes after inserting 380000 records i.e. at 39th batch execution.
  This is the error I get,</p>
  
  <blockquote>
    <p>Error in .jcall(ps, "[I", "executeBatch") :<br>
    java.sql.BatchUpdateException: [Teradata JDBC Driver] [TeraJDBC
    15.10.00.22] [Error 1338] [SQLState HY000] A failure occurred while executing a PreparedStatement batch request. Details of the failure
    can be found in the exception chain that is accessible with
    getNextException.</p>
  </blockquote>
  
  <p>I've tried changing to a different set of rows from the same dataframe. And, behavior remains same, crashes at the 39th batch execution.</p>
  
  <p>Any idea what is this <code>Error 1338</code> and what could be the fix?
  Also, it mentions about <code>getNextException</code> but how do I use that with R?</p>
  
  <p>The approach I'm using is similar to this one
  <a href="https://developer.teradata.com/blog/ulrich/2013/11/a-wider-test-case-on-r-jdbc-fastload" rel="nofollow">https://developer.teradata.com/blog/ulrich/2013/11/a-wider-test-case-on-r-jdbc-fastload</a></p>