Suman,

Can you tell from the CSV file (contents or filename, e.g.) what the 
destination table would be? If so you could get that out into an attribute, 
then use ConvertCSVToAvro -> ConvertAvroToJSON -> SplitJson -> ConvertJSONToSQL 
-> PutSQL

The table name attribute would go into the Table Name property of 
ConvertJSONToSQL, using expression language (such as ${table.name}).

This seems a bit of a long-winded flow for its purpose, and it is. In NiFi 
1.2.0, if you know the possible schemas for the CSV files, once the file is in 
NiFi you will be able to use PutDatabaseRecord (with the appropriate CSV 
Reader) to do the whole thing.

Regards,
Matt

> On May 3, 2017, at 1:11 PM, "[email protected]" <[email protected]> wrote:
> 
> Hi ,
> We receive csv files from client. Each csv files contains different headers
> . We want to save the csv content in different tables . each table per csv
> and column name as per csv header.
> 
> Please advice.
> 
> 
> 
> --
> View this message in context: 
> http://apache-nifi-developer-list.39713.n7.nabble.com/Save-CSV-file-contents-to-database-tables-tp15644.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Reply via email to