0

I have a requirement where we can get list of file names from SQL and need to pass these file names as variable to Step which can poll folder for these file names as text file. Please advise how to set SQL output of file names as array variable and pass to polling folder step ?

Madhup Srivastava
  • 446
  • 1
  • 6
  • 18

1 Answers1

2

Don't use variables. Variables are only suitable if your input has 1 single row.

Instead, use two transformations inside a parent job. The first transformation gets a list of filenames and passes those to a step Copy Rows to Result;

The second transformation can do one of two things:

  1. Process all files at once: just use a Get Rows from Result step as your entry point to the transformation;

  2. Process one file at a time: create a parameter for the filename on the transformation; open the parent job, and on the properties of the transformation go to Advanced and tick the box "Execute for every input row" and on Parameters put the child trans parameter name and the stream column name coming from the 1st transformation.

nsousa
  • 4,448
  • 1
  • 10
  • 15
  • Thanks for response. For second transformation I tried step 1 specified above, but I don't see list of filenames there. Is there any way to debug that ? – Madhup Srivastava Apr 24 '15 at 15:01
  • The filenames arrive as a field. You don't see them while editing in spoon. To debug I usually do a generate rows or data grid to generate sample data so I can develop. – nsousa Apr 25 '15 at 15:04