# Writing Excel Sheets to Database in a Loop

**URL:** <https://forum.knime.com/t/writing-excel-sheets-to-database-in-a-loop/25218>\
**Category:** KNIME Analytics Platform\
**Created:** [July 12, 2020, 3:19pm UTC](https://forum.knime.com/t/writing-excel-sheets-to-database-in-a-loop/25218 "2020-07-12T15:19:18Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![VenkataK](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/v/9fc29f/32.png) [@VenkataK](https://forum.knime.com/u/VenkataK)\
**Post date:** [July 14, 2020, 6:32am UTC](https://forum.knime.com/t/writing-excel-sheets-to-database-in-a-loop/25218/3 "2020-07-14T06:32:16Z")

</div>

Hi,

Thanks for your reply. Looks like I didn’t articulate my problem correctly. I am using only one excel with multiple sheets and I am able to read all of them. First row of all the three sheets is the column header for the corresponding db table field names. When I try to insert using DB writer, I am able to insert the first sheet into the first table properly. But when the loop progresses, in the second iteration it fails. It takes the table name correctly (sheet two’s name - test2), as I have set it as a flow variable (table name -\> Shee) but the column names are still showing table one’s column names. It’s not changing dynamically.

I’ve attached the excel and .knwf files for your reference.

Please help.

Thanks  
Venkata

---

_[View the full topic](https://forum.knime.com/t/writing-excel-sheets-to-database-in-a-loop/25218)._
