Teradata Fastload not working for any other delimiter

Tools
Enthusiast

Teradata Fastload not working for any other delimiter

Hi All,

             I am facing an issue with the Teradata fastload java code. The code worked perfectly fine for |,comma and ; as delimiters but today when I tried the same I am getting exceptions like:

 SQL State = HY000, Error Code = 1390

java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 15.00.00.20] [Error 1390] [SQLState HY000] FastLoad CSV failed because InputStream row 1 contains 2 column value(s), instead of the expected 1 column value(s).

        at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:94)

        at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:79)

        at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:106)

        at com.teradata.jdbc.jdbc.fastload.FastLoadCSVPreparedStatement.executeUpdate(FastLoadCSVPreparedStatement.java:1237)

The same exception I am getting for all other delimiters except for comma delimiter.

sample data file is as below:

shekhar|32

andrew|28

Paul|37

...

Same data is use for ; as delimiter as well. 

I have not made any changes to the current code. Can any one help me understand why we get this exceptions?

Regards

Shekhar

Tags (1)
2 REPLIES
Teradata Employee

Re: Teradata Fastload not working for any other delimiter

The default separator used by JDBC FastLoad CSV is the comma ( , )

To use a different separator with JDBC FastLoad CSV, you must specify the FIELD_SEP connection parameter. It is documented in the Teradata JDBC Driver User Guide here on Developer Exchange.

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_2.html#URL_FIEL...

Also, keep in mind that JDBC FastLoad CSV requires an initial row of column titles, which are not inserted into the destination table. The number of columns in the column title row must match the number of columns in the subsequent data rows. This is also documented in the Teradata JDBC Driver User Guide here on Developer Exchange.

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_2.html#BABFGFA2

So there are at least of couple of possibilities why you are having difficulty with using a different separator:

1. Perhaps you did not specify the different separator with the FIELD_SEP connection parameter.

2. Or perhaps you changed the separator in the column titles row but not the data rows, or vice-versa.

Enthusiast

Re: Teradata Fastload not working for any other delimiter

Thank you very much @tomnolan.. Its working now ... :)