Support Questions

Find answers, ask questions, and share your expertise

Is it possible to create a table in mysql using nifi, the data comes in excel from?

avatar
Rising Star

Hi,

  I did nifi and mysql setup in stand alone machine, where I have scenario the input will be in excel form, i need to create table in mysql db.

I have seen processors where we can do UPDATE, INSERT, or DELETE SQL, does create will be possible?

 

Also Do I need to write custom processor to extract the column names from the excel?

 

 

1 ACCEPTED SOLUTION

avatar
Super Guru

@murali2425  It sure is possible.  I believe anything is possible in NiFi!!   The excel processor is: ConvertExcelToCSVProcessor 

 

I have also put an Excel to SQL template on my GitHub:

https://github.com/steven-dfheinz/NiFi-Templates

 

This template gets an excel file that contains product inventory data (sku, name, price, description, quantity, etc and routes the contents of the excel file to ConvertsExceltoCSV.  Then it splits the csv file line by line, parses each line for quantity and sku and uses those attributes to build an insert query, which is finally executed via PutSQL.

 

There are many different ways to deliver the Excel file too ConvertExceltoCsv, different ways to process the CSV, and different ways to insert into SQL.  The above is just one way I have used in the past.

 

 

View solution in original post

2 REPLIES 2

avatar
Super Guru

@murali2425  It sure is possible.  I believe anything is possible in NiFi!!   The excel processor is: ConvertExcelToCSVProcessor 

 

I have also put an Excel to SQL template on my GitHub:

https://github.com/steven-dfheinz/NiFi-Templates

 

This template gets an excel file that contains product inventory data (sku, name, price, description, quantity, etc and routes the contents of the excel file to ConvertsExceltoCSV.  Then it splits the csv file line by line, parses each line for quantity and sku and uses those attributes to build an insert query, which is finally executed via PutSQL.

 

There are many different ways to deliver the Excel file too ConvertExceltoCsv, different ways to process the CSV, and different ways to insert into SQL.  The above is just one way I have used in the past.

 

 

avatar
Rising Star

great and Thanks it was very useful for my work.

 

Here I will be having data in the excel, I need to extract the column names(1st row) and form the create the table with primary key and foreign key  and data(2nd row) in the database(mysql) from nifi.