One Star

Providing Excel sheets and a connection string as inputs while Packagi

I have designed a job to copy Excel data to SQL tables (18 of them). Now I want to package it. Since I am new to this I don't know how to proceed.
I want to package it in a way that user can provide Excel input sheets and a connection string. And my executable file will copy data from this 'n' number of input sheets to the hard-coded tables. Now user might want to copy data from any number of tables.
My workflow is
Stored Procedure -> excel input -> tMap -> tMSSql
|
on sub job ok
|
excel input -> tMap -> tMSSql
|
on sub job ok
|
......
|
excel input -> tMap -> tMSSql
I want to know where and how to define these as input parameters? Or whatever the other way it works in Talend.
4 REPLIES
One Star

Re: Providing Excel sheets and a connection string as inputs while Packagi

How do I use context variables for DB connection and Excel inputs (location + file name) ?
Is there something wrong with my question or Talend is just not popular enough to solve doubts?
One Star

Re: Providing Excel sheets and a connection string as inputs while Packagi

I have taken a context variable named WorkbookPath. And provided it's default value as 'C:/Users/Administrator/Desktop/Workbook1.xlsx' (with out the comma).
So now all of my Excel inputs will have 'context.WorkbookPath' (with out the commas) written in it's 'File name/Stream' field?
And how do I provide my input the value to look for particular work sheet in that workbook?
Moderator

Re: Providing Excel sheets and a connection string as inputs while Packagi

Hi,
Your Excel sheets(18 of them) are same column structure/schema structure?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Providing Excel sheets and a connection string as inputs while Packagi

Hello,
No, my sheets are of different structures.
I have 1 excel workbook, which has 18 worksheets. I have been able to copy data from these 18 sheets to 18 tables with different schema. (Everything hard coded)
Schema of my tables will remain same but my workbook location may change. For that I want to use context variables for Excel workbook location.
I also want to use context variable to establish DB connection. (I am using SQL server 2008)
Please guide me through these two tasks.
Thanks,
Yuvraj.