Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to provide correct arguments to setAsciiStream method?
    primarykey
    data
    text
    <p>This is my <strong>FULL</strong> test code with the main method:</p> <pre><code>public class TestSetAscii { public static void main(String[] args) throws SQLException, FileNotFoundException { String dataFile = "FastLoad1.csv"; String insertTable = "INSERT INTO " + "myTableName" + " VALUES(?,?,?)"; Connection conStd = DriverManager.getConnection("jdbc:xxxxx", "xxxxxx", "xxxxx"); InputStream dataStream = new FileInputStream(new File(dataFile)); PreparedStatement pstmtFld = conStd.prepareStatement(insertTable); // Until this line everything is awesome pstmtFld.setAsciiStream(1, dataStream, -1); // This line fails System.out.println("works"); } } </code></pre> <p>I get the "cbColDef value out of range" error</p> <pre><code>Exception in thread "main" java.sql.SQLException: [Teradata][ODBC Teradata Driver] Invalid precision: cbColDef value out of range at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterAtExec(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setStream(Unknown Source) at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setAsciiStream(Unknown Source) at file.TestSetAscii.main(TestSetAscii.java:21) </code></pre> <p>Here is the link to my <a href="https://dl.dropboxusercontent.com/u/41007907/FastLoad1.csv" rel="nofollow noreferrer">FastLoad1.csv</a> file. I guess that <code>setAsciiStream</code> fails because of the <a href="https://dl.dropboxusercontent.com/u/41007907/FastLoad1.csv" rel="nofollow noreferrer">FastLoad1.csv</a> file , but I am not sure</p> <p><em>(In my previous <a href="https://stackoverflow.com/questions/20169127/what-is-illegalstateexception?noredirect=1#comment30067341_20169127">question</a> I was not able to narrow down the problem that I had. Now I have shortened the code.)</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload