Set tFileList Filemask from records in SQL Table

One Star

Set tFileList Filemask from records in SQL Table

I would like to dynamically set the filemask parameter of a tFileList component using records queried from a SQL Table.
for instance:
FileMask now:
GL_*.xls
Query distinct records from a table, results in:
12345
23456
34567
FileMask wanted:
GL_12345.xls
GL_23456.xls
GL_34567.xls
I assume the code would be similar to:
tFileList1.add.files(GL_12345.xls)
Thanks,
Jim
Seven Stars

Re: Set tFileList Filemask from records in SQL Table

Why do you need tFileList if you know from the table what the file names are? You can just iterate through the table records processing the files as required. Looking at the code generated by tFileList, it appears that you can't add file masks dynamically. The best you could do would be to pre-define a number of context or globalMap variables to use in your tFileList and then populate those variables from your table records.
One Star

Re: Set tFileList Filemask from records in SQL Table

Good point, I hadn't thought about taking that direction. The process is a bit more complex than in my example, but it's still a valid option.
One Star

Re: Set tFileList Filemask from records in SQL Table

A bit more detail, we also have the period end date as a portion of the filename so the FileList use is still worthwhile. Below is actually the filemask needed as we can receive files for multiple periods as well as files from facilities we're not yet ready to process.
FileMask wanted:
GL_12345_*.xls
GL_23456_*.xls
GL_34567_*.xls
Seven Stars

Re: Set tFileList Filemask from records in SQL Table

I would suggest then just having one globalMap variable used as part of your tFileList mask and iterate through your table records to populate the variable and call tFileList.
One Star

Re: Set tFileList Filemask from records in SQL Table

Terrific! Thanks so much for your help and suggestions.