0

I'm trying to capture filename being input to my data source into table column source_file, for the filename I created a job parameter sales*; I tested it with files sales.xlsx and sales_copy.xlsx.

It successfully executed to input the data except for the source_file column in the database, it should be sales.xlsx and sales_copy.xlsx. But what the database read is sales* because in the mapping derivation for source_file column I set it as source_param which value is sales*.

How do make I it specifically read the filename sales.xlsx and sales_copy.xlsx not sales*?

4

2 回答 2

1

I don't think it takes the names from the parameter value as a column in the parallel job when you define it as 'Sales*.xls' (It takes Sales*.xls as a constant no mater where you define it either in the sequential file as a file name or you pass it as a parameter).
What you can do is

  1. Define your parallel job where you define File Name Column as column name in sequential file stage (Where you import the data), and the file name has to be defined by the parameter.
  2. Create a Sequential file where you call the above parallel job in a loop where you pass all the file names as a loop counter for the file name parameter(Loop works both strings and numeric values).
于 2020-09-07T14:53:06.067 回答
0

It isn't clear where you're trying to do this, and what you are trying to accomplish. For a start, "sales*" is not a valid name for a job parameter. Let's assume there's a job parmaeter called jpFileName. To refer to this parameter in the job you need a reference; that is, the parameter name surrounded by "#" characters, for example #jpFileName#. You would use this reference in the derivation of the output column source_file; I strongly suggest that you use the expression editor to select the parameter reference. When the job is run, the value "sales.xlsx" is provided as the parameter value on one run, and the value "sales_copy.xlsx" is provided as the parameter value on the other run.

于 2020-09-07T05:58:16.720 回答