Fastload using Java API fails with \t delimiter

Tools & Utilities
Enthusiast

Fastload using Java API fails with \t delimiter

Hi All,

              I am working on a code to export data from a file to Teradata. For this I am using Fastload Java API.

              I am facing an issue when I try to use tab as the delimiter. 

              The url which I am using to create a fastload jdbc connection is as below:

              FASTLOAD_JDBC_URL=jdbc:teradata://myserver/FIELD_SEP=\u0009,TMODE=ANSI,CHARSET=UTF8,TYPE=FASTLOADCSV

               I am getting the following error:

              SQL State = HY000, Error Code = 1399

java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 15.00.00.20] [Error 1399] [SQLState HY000] FIELD_SEP connection parameter value \t is not valid because it is more than 1 byte long

           Can anybody tell me how we can resolve this. 

 Thanks & Regards

Shekhar

1 REPLY
Enthusiast

Re: Fastload using Java API fails with \t delimiter

After some more analysis and trial with the code now I am getting the following exception:

15/04/10 07:04:54 INFO mytest.Export: 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 3 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 field delimiter used by me is \u0009 (tab). 

Please help me with this.. 

Regards

Shekhar