Quantcast
Channel: Teradata Forums - Tools
Viewing all articles
Browse latest Browse all 4252

Fastload Skips Header when using from Java - response (2) by tomnolan

$
0
0

By the way, here is a code snippet to illustrate how to dynamically prepend a column header line to a CSV InputStream. The basic idea is to use a SequenceInputStream to combine the column header line with the actual data.
 

String sHeaderLine = "column1,column2,column3" + System.getProperty ("line.separator") ;
InputStream isHeader = new ByteArrayInputStream (sHeaderLine.getBytes ("ASCII")) ;
InputStream isData = new FileInputStream ("data.csv") ;
InputStream isCombined = new SequenceInputStream (isHeader, isData) ;

 
Instead of binding the InputStream containing the data values to the JDBC FastLoad CSV PreparedStatement, your application would bind the combined InputStream.
 


Viewing all articles
Browse latest Browse all 4252

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>